3 ms·
Implementing some dynamic data structures should give you a good understanding of how pointers work and allocating and freeing memory. Start with linked lists,
by kristianp 10y ago
Implementing some dynamic data structures should give you a good understanding of how pointers work and allocating and freeing memory. Start with linked lists, then binary trees, then B-trees if you have time. Priority queues (heaps) are fun too.
- colanderman 10y agoExactly this. Implementing low-level algorithms focuses on C's strengths: arrays (memory layout) and manual memory allocation. They will be your biggest blind spots coming from a dynamic language, and they are the primary reason one would use C. After that I would move on to implementing something like a telnet or simple HTTP server, focusing on using sockets and processes correctly: handling all error cases, ensuring no deadlock, etc. That is C's other strength: it is the language of Unix.