C Programming Tutorials

Quick guides for C & UNIX


This is a growing list of very brief tutorials on various aspects of C and Unix programming. By Unix, I refer to the various flavors of Linux, Solaris (SunOS), System V, FreeBSD, NetBSD, OpenBSD, Meego, and OS X. I test the examples on a Mac running OS X. While I will try to point out any modifications needed for Linux and/or SunOS, you may have to tweak some of the #include headers. If things aren't compiling, be sure to check the manual pages on your system for proper usage (e.g., man fork). The usage syntax will tell you what headers need to be included.

My goal is to make the tutorials and sample code as short as possible — something you can use and build on if you want to. Many of the funcitons or system calls presented have extra layers of complexity and options that I will not cover. Be sure to consult the man page or more detailed sources if you want to understand the details.

Playing with processes

I/O redirection and IPC


C Essentials

Basic algorithms


The Practice of Programming


The C Programming Language


The UNIX Programming Environment