Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Pointers are just numbers (You can even add and subtract them)! They represent where your data is in memory.
Try to avoid malloc but don't be afraid of it. It's just a slow operation.
The #include uses <> around .h files your SYSTEM has, and "" around .h files your PROJECT has.
Structs are your best friend.
String input from the command line is a bitch!
Strings are a bitch!
C is a bitch!
The best bitch. -
Kirk2767y@Lasagna I know it's a basic question, but what's the best way to set up a C compiler on Windows? This is all new to me and I'm pretty lost :/
-
@AlgoRythm As a C-noob: What's the alternative to malloc? I mean a pointer needs memory and how else is it supposed to get it?
@Kirk If you're a student, I'd recommend downloading Cygwin as a C-compiler anf JetBrains CLion. In my case, CLion pretty much handled and setup everything for me -
brahn15747yIt is the software equivalent of an elephant gun, check your aim twice and try not to shoot your 'nads off!
-
cyclic3407y@gathurian If you are uncertain if/when you need a lot of memory, use malloc. Otherwise use a stack allocated variable. Also be aware that most os will look your program if you stack allocate a massive buffer
-
py2js33777yWhy not learn go or rust they are also quite fast. Not comparing go to C but go is pretty fast and a nice alternative to C
-
TobyAsE28447yUse valgrind, it really helps finding those nasty memory leaks that randomly coulse your program to crash somewhere.
Related Rants
Today I started setting up an environment to learn C. It's my first dive into anything more complex than PHP. Wish me luck!
Also, any hints for a beginner in C?
random
programming
beginning my journey
c