What's a good practical way to get my feet wet with C? I want to learn it, but I'm the sort of person that can only learn a language by actually trying to build something useful in it. Sometimes it seems like a language that everyone thinks is important to know, but that no one thinks should actually be used in a real world project unless you're working on embedded systems or building an OS. What are some ideal (and beginner-friendly) use cases?
Go download SDL 2.0 and build a simple breakout game, or space invaders, or something. Add networking support.
You won't get to hide from the annoying stuff in C (memory allocation, string manipulation, etc.), but the problem space (a simple game) is right there. It's also something that many, many people have done before, so it'll be easy to start.
Thanks, I really like the simple game idea, and SDL looks like a cool framework. Also neat that it can compile to ios/android-compatible binary (though perhaps that would introduce a new can of worms).
Thanks, I'm actually going through Learn C The Hard Way now, but it's the sort of thing that doesn't really work for me. I just need to work on some cool little app idea that C is well suited for and learn/bang my head against the wall until I figure it out. The problem is that I can't seem to come up with anything small and practical to build that anyone actually thinks should be done in C. It's like there are beginner tutorials on one end, linux kernel hacking/database internals/NASA robots on the other end, and nothing in the middle. My experience with other languages and areas of interest are fairly wide, so it seems like I should be able to come up with something, but I'm feeling sort of at a loss.
I think writing a C compiler in C is probably the most effective way of learning pure C, although probably not the most efficient. You don't even need to generate assembly code, you can just compile to C itself or some other language.
Maybe just reimplement some piece of existing software you wrote with a C version? I want to port a small node-based API to C in the future, just to see what it takes.