3 ms·
I'd suggest you start dissecting small programs written in C. Those UNIX tools you were talking about? Grab some UNIX tools, see how they work. Dissect cat, gre
by Kliment 17y ago
I'd suggest you start dissecting small programs written in C. Those UNIX tools you were talking about? Grab some UNIX tools, see how they work. Dissect cat, grep, etc. It's the best way to learn.
- nailer 17y agoHmn, good point. I remember wanting to see how top got some of it's stats a while ago and wandering through the C source. Something simpler would be pretty quick. fetches the coreutils source Thanks.
- mdg 17y agoPlan 9 versions of these tools are straight forward: http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/ http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/
- deleted 17y ago[deleted]
- tptacek 17y agoI vividly remember C "clicking" for me with the "getpwnam()" function. Which is to say, go to /usr/share/man/man3, pick an interesting function, and write the (bad) 20-line program that makes it work.
- jshen 17y agoi don't know that I'd start or even look at grep ;)
- Kliment 17y agoIt sure ain't pretty, but it does teach you C. The source code is fairly well documented and does some complex stuff.
- jacquesm 17y agoGrep is actually a really good example. First program your own version of it, then look at the guts of grep and be amazed at how elegant that solution to the problem is. And if you come up with the same solution without peeking you will probably be able to name your own price at some point.