On 21 June 2012 12:22, Gilles Chehade <gil...@poolp.org> wrote: > On Thu, Jun 21, 2012 at 12:09:47PM -0300, Christiano F. Haesbaert wrote: >> Tedu's suggestion is the best one in my IMHO, implement a webserver. >> >> I would try to do the following: >> - Read K&R >> - Join ##c on freenode, they can help a *lot*. >> - Read manpages of every function. >> - Code small UNIX utilities, start with cat, then wc. >> - Code something like a webserver, this is where you'll actually learn. >> > > Actually, before a webserver, I'd recommend learning how to write a shell > as it will have you deal with lots of concepts you would not see > otherwise ... then network programming :-p >
Yep shell is a good example. One small task I used to pass to people wanting to learn C, is to implement a strtok-like function, they could design their own API. It is interesting because they need to deal with pointers, strings, and design an API as in: - should I pass a fixed array and alloc all tokens ? - should I return an alloced "structure" ? - should I modify the string in place as strtok ? should I copy. A lot of decisions have to be made, and it's interesting to see how they approach it.