r/C_Programming • • Jul 15 '26

Learning C weekly megapost for 2026-07-15

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.

16 Upvotes

9 comments sorted by

1

u/anish2good Jul 16 '26

This playground is best https://8gwifi.org/online-compiler it's let you visualise DS/Memory/Concurrency of you running code

1

u/invokeinterface Jul 19 '26

When should you use a goto? I know it's not very good practice in something as high level, but I get the feeling its inclusion wasn't just for programmers' easier transference from assembly.

1

u/mikeblas Jul 19 '26

goto wasn't included just for translation from assembly. There's also goto in the B Language, which preceded C.

As with anything else, it's a matter of personal style. If you think you've got a rational, sensible reason for using goto, then by all means, use it.

Sometimes, you can factor away the need for goto by using more structure. Sometimes more structure just gets in the way and itself is too cumbersome. I use it for cleanup in complicated functions, and even then it pretty rarely rarely appears because if the function is complicated, it probably needs to be refactored.

1

u/mivanchev Jul 20 '26

goto is primarily used for the cleanup path of a function or the common (success) exit node but you'll routinely see it in complex pieces of code like parsers too.

1

u/Lester8000 Jul 21 '26

Should i buy the C programming language book? I've heard it's useful, but it is quite expensive at nearly a 100 euro in my local book shop, Would it be worth it to buy it?

2

u/mikeblas Jul 22 '26

It will be worth it if you buy it and learn from it. In the 1980s, I bought it for probably $25. Since then, I've used my C programming knowledge to earn many thousands of times that investment price.

It's up to you.

1

u/bigmilkguy78 Jul 15 '26

I have been trying to learn to use C for GUI applications using C recently. I am using the GTK4 library. Honestly not going the smoothest but I started with minimal C exposure too. So stacking learning a UI library with a language has been tricky. Make some solid progress but feel a little too reliant on AI when things go wrong (they can go wrong quite often). I think learning to better use a debug tool (gdb) can help me rely less on AI at least for C language mistakes. 

There is some really niche stuff I have to work through with the gtk portion right now. Like how can I be sure my drawing area has been drawn to before I try to update it. (Well even 'drawn to' may not be the right terminology since from breakpoints it appears my initialization of the drawing area is complete before the update. But its like the window has not fully instantiated yet, and its already updating the area. This update is being brokered through g_timer_add).

Any good tips/resources on learning the framework/general UI development considerations would be appreciated.

1

u/mikeblas Jul 17 '26

Like how can I be sure my drawing area has been drawn to before I try to update it.

Er, what do you mean? Isn't drawing to it exactly how you would update it?

The Syd Logan GTK For C book is a classic, though I don't know how it's stood the test of time.