r/cprogramming • u/levidas7272 • Sep 16 '26
i started c programming
hey guys i just started learning c programming language from code with harry.
any advice from those who already mastered it?
20
Upvotes
11
u/Cam64 Sep 16 '26
master the concept of pointers
5
u/tastygames_official Sep 16 '26
you never truly master it, but what really made it click for me was also learning about how comupter hardware works and learning assembly. Not saying you should go for that right away, but knowing that when you use memcpy() or create a new variable and assign a value to it, what is really actually happening on the hardware.
2
u/jack_dymond_sawyer Sep 16 '26 •
The C language is about dualities. It is both high level and low level. You will need to know that syntax / errors work entirely different at compile time and run time. Understand the scope of your variables effects both--that memory is allocated automatically for the program during loading (static data the compiler takes care of this), dynamically via the stack (passing arguments, mostly compiler takes care of this), and explicitly dynamically at run time with malloc & free (all on the programmer). Learning this language should involve a deeper understand of the hardware architecture and the software interface of your operating system. This is where the fun begins. Good luck!
2
u/SmokeMuch7356 Sep 16 '26 edited Sep 17 '26
It is simultaneously easier and harder than it looks. C has what I call a "flat" learning curve; it's easy enough to learn the basics, but I guarantee that 10 years from now you're still going to be saying "oh, so that's how it works!"
It took me on the order of 15 years before I understood declaration syntax; not just what the rules are, but why they're structured like that. Granted, I never thought too deeply about it, but it still took a while before that epiphany.
Beware; many tutorials get some basic facts wrong and promote bad practice. Any tutorial that confidently tells you "an array is just a pointer" or that
x++ + x++has a consistent, well-defined answer is probably getting some other things wrong.2
u/Layomx Sep 17 '26
Good decision, C is a really good programming language, please, learn pointers, pointerns are the most important concept on C programming, you will not master C at all, you will need a lot a of time and C is still developing and everything is down to change, but control pointers, control your memory managment, research aboyt the stack and the heap and you will be good. MOST IMPORTANT THING IN C PROGRAMMING IS ENJOYING THE LANGUAGE. I recommend Modern C Programming, it is a book, good reading.
2
u/piiodda Sep 16 '26
Hey, awesome that you started! Good luck with the journey, consistency is key.
It helped me a lot to build small personal projects, like a terminal tic tac toe game or a simple text file reader/writer. Definitely play around with the standard libraries and compiler flags, too.
Have fun! :)
1
u/rphii_ Sep 17 '26
don't be scared of structs
2
u/Humble-Captain3418 Sep 17 '26
Put
typedef int bro;at the top of your program.1
u/EquipmentCandid3787 Sep 17 '26
just remember in c the compiler needs to see the data type or the return type before the identifier name.
otherwise you are just playing with garbage values
1
u/DanKegel Sep 17 '26 edited Sep 17 '26
To really learn pointers, learn assembly language... at least to the point where you can see what standard library string functions are doing when you paste their source into https://godbolt.org with a simple target like x86.
Just for fun, here's some assembly that is very much like the first machine language program I wrote back in 1977 or so; this was written around 1986. Figure out how the beep function works!
https://github.com/FDOS/ansi/blob/129904f66692147b4bc361af912bfebb1766b160/source/nansi.asm#L1392
Once x86 assembly makes sense, C will make more sense. C is just a very nice assembler.
1
u/ilPlayerdiGD Sep 18 '26
idk a me piace creare giochi in C/C++ e ti dico che l'unico modo per impararlo veramente e in modo divertente è fare progetti di robe che ti piacciono. 👍
1
u/[deleted] Sep 16 '26
[removed] — view removed comment
1
u/[deleted] Sep 17 '26
[removed] — view removed comment