Sample C programs

  1. createstrings.c: a C program that demonstrates string manipulation. In particular, it shows how to start with a 5-letter word and generate all 5-letter strings that differ from it in exactly one letter in exactly one position.
  2. inputoutput.c: a C program that shows how to do file input-output in C.
  3. arraytest.c: a C program that shows how to declare and use arrays.
  4. passargs.c: a C program that demonstrates how to pass arguments in and out of C functions.
  5. pointer.c: a C program that demonstrates C pointers. It shows the dereference operator, the memory allocation function (malloc), and the memory deallocation function (free).
  6. singlylinkedlist.c: a C program that shows how to define and use a singly linked list.