Sample programs

NOTE: I tend to way overcomment these programs, since they are intended as pedagogical programs, not production programs. You're welcome to borrow code from these samples, but keep the commenting advice in our style guide in mind for your own code.

For most of our programs, you should use the following compilation approach. We'll discuss all the parts of this command over the first few days of the term.

gcc -Wall -Werror -O0 -g -o hello hello.c

Samples