Some example C files:

These files end in .c.txt rather than .c, since some browsers will not display .c files as plain text. If you want to download, compile, and run them, remove the .txt extension after downloading.

A program with an array, a loop, and a sub-function... A program with 2 source files & a header file that illustrates pass-by-value and the use of pointers to implement pass-by-reference... A program with a struct that illustrates the syntax for dereferencing members of a structure and members of a structure via a structure pointer. A program demonstrating fgets to read a string from the standard input. This program then prints the decimal and octal representations for the ASCII value of each character read in.