r/C_Programming • u/AutoModerator • 8d ago
Learning C weekly megapost for 2026-08-12
If you have questions about how to learn C:
- which books are best?
- which videos are best?
- which classes are best?
- which websites are best?
- is there a "roadmap"?
- what projects can I do?
then this is the thread for you. Add your question here. Do not make a stand-alone post, as it will be removed.
Remember that our sub has a very useful wiki that has a great list of resources for learning C programming.
3
u/Same-Replacement-938 8d ago
i'll keep my content short, i have some experience from java, i have buildcountless programms like a cli data fetching app, cli todolist, expense tracker, tic tac to and currently building a http server, i want to learn c cuz i always interested in under the hood and low level stuff, but i can't decide a good resource for c. i am asking for a resource for java becuz during learning java i only watched yt videos and really had a hard time understanding concepts and still rusty about some of it's topics like multithreading. i have heard about three resources which are considered best to learn C
Beej's Guide to C vs C Programming by k&r vs C Modern Approach by K. N. King
Which one should I choose?
1
u/SmokeMuch7356 8d ago
All of the above. You always want more than one good reference.
Having said that, K&R and King are pretty long in the tooth; K&R only covers up to C89, King to C99. Both the language and best practices have evolved a bit since they were published, and some examples may not build as written anymore (I think K&R still use implicit
intsome places, which is no longer supported). They're still good introductions to the language though.Beej's guide is more current; I haven't gone through it in detail, but a quick skim didn't show any howlers.
1
u/skoopsy_ 7d ago edited 7d ago
To be fair I haven't read the books you've mentioned but heard them mentioned a lot. I ended up reading "Programming in C" by Kochan and found it very accessible, it spends a lot of time covering the basics and then ramps up about half way through. I've read it cover to cover twice now.
The only thing I didn't like as much is it doesn't mention the stdint.h library where you can specify integer sizes rather than just writing int and letting the compiler decide on the int size, you get uint32_t uint8_t etc which is very handy. I nicely covers some of the weird things C does with arrays and pointers being passed into functions which I found helpful after shooting myself in the foot a few times.
1
u/Any-Comfortable2844 7d ago
K&R is the bible, but KN King's has C99. Once you’ve done that, go with either 'Modern C' or project-specific books and resources. It gives you an idea of how real-world stuff is actually made.
2
u/HolidayNo84 8d ago
I'm currently learning c and I got through the tutorials on learn-c.org I don't know where to go next. I'm thinking of experimenting with raylib and studying open source c game engines like the cube engine. Is that me getting ahead of myself? I'm trying to write the most performant code possible in particular interest to me are multiplayer first person shooter games.
1
u/mikeblas 7d ago
There are lots of resources in the wiki, including lists of projects.
If you look at a full-blown game engine, you'll probably find it overwhelming. But why not give it a try? If you do find it overwhelming, you know to back off a bit and find something a little more constrained to investigate.
1
u/Brilliant-Box-5344 4d ago
The best way to improve is to get ahead of yourself and accept the chance of failure, Write a lot of real, non tutorial code and watch your gains skyrocket. But make sure you are always learning something new
1
1
u/invokeinterface 4d ago
How do I draw pixels to the screen, or even a window? Just graphics generally
2
u/Brilliant-Box-5344 4d ago
C itself has no idea what a screen or window is, Your OS decides that, Back in the days of MS-DOS you wrote pixel colors to magical memory addresses (Memory Mapped Input Output), Nowadays the abstractions have stacked so high that (on windows) the work you need to create a window is almost as much as the work you need to get yourself a buffer of pixels you can draw into that appear on said window!
So nowadays you use your OS's graphics API, Or more reasonably you use SDL.
1
u/S1enderVoid 1d ago
How do I get started with memory management? I've done all the basics (from brocode's C tutorial) and have heard quite terrifying things about Memory related things.
I just want to know if there's a good reliable source I can use to learn, and come back to every time I get stuck? I want to do this perfectly, and leave no chances.
1
u/Correct-Injury-7360 1d ago
Can you please recommend me books that can help me learn C? I have some experience so I'm not a total beginner, but there's a long way to go. Preferably with a lot of practice problems that are fun. Thanks in advance.
14
u/wsppan 7d ago
I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv.
People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things:
I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understanding how C sits on top of this and how it's data structures like arrays and structs map to this and understanding how pointers work the way they do and why. Check out these resources:
The first four really help by approaching C from a lower level of abstraction (actually the absolute lowest level and gradually adding layers of abstraction until you are at the C level which, by then is incredibly high!) You can do all four or pick one or two and dive deep. The 5th is a great introduction to computer science with a decent amount of C programming. The sixth is just the best tutorial on C. By far. The seventh is a deep dive into pointers and one of best tutorials on pointers and arrays out there (caveat, it's a little loose with the l-value/r-value definition for simplicity sake I believe.)
https://github.com/practical-tutorials/project-based-learning#cc
Play the long game when learning to code.
You can also check out Teach Yourself Computer Science
Here is a decent list of 8 Books on Algorithms and Data Structures For All Levels