I am able to program in Lisp, Python, Ruby, JavaScript and Prolog and I have been willing to learn how to program in C for a very long time now. I know the syntax and basic concepts (I've actually read Kernigham & Ritchie), but I've never been able to pass through the writing “Hello world!” stage.
So, my problem is related not to the language itself, but rather to everything else that you need to do sensible development in C. I never quite figured out how to use libraries, what are the capabilities of the Standard Library, what is the good way of getting Unicode (I hope there is one), how do I get hashes and so on. Oh, not to mention that stuff like the linker, what should be the compile flags and so on are black magic to me. I have problems with the pragmatics of programming in C.
What would you recommend me to do in order to finally learn C?
- Are there any really good tutorials or books?
- Are there any libraries known to be easy to interact with that would allow me to learn what the best practices are?
- Are there any Open Source projects to which I should be able to contribute quite fast and which present a good programming style?
- Writing what pet projects would be optimal from the learning point of view? In other languages I usually write a Sudoku solver or a Red-Back trees implementation to get the feeling.
I'd like to be able to:
- write programs interacting with libraries,
- write a Python module in C,
- create the CFFI bindings for Common Lisp for a C library
- write extensions to SQLite or PostgreSQL
So as you can see I am not really interested in kernel hacking or hardcore algorithms at this point.
I am a Linux and Emacs user.
Important
I do have Kernigham and Ritchie. Thus the subquestion What next after K&R?