Example code is stored in my home directory on the classes.csc.lsu.edu server in "~cs2700_tra/examples/". Check it for updates and additions throughout the semester and use standard Linux commands to copy the contents to your home directory for experimentation or inclusion in programming assignments. Better yet, use rsync to quickly sync my latest changes (instructions below).
Sign in to classes.csc and list my example directory:
$ ls -lah ~cs2700_tra/examples
Each folder starts with a lecture number and contains code examples relevant to that lecture. To copy all of the code use:
$ rsync -a ~cs2700_tra/examples/ ~/examples/
This places the code in your home in a folder called "examples/" Note that you can run this at any time to get the latest examples, but if you have made any changes to files, they will be overwritten. I recommend that you make new directories for any modified programs you wish to test, then their contents won't be affected by rsync.
As a reminder, to compile a basic C program use:
$ gcc *.c
This will compile any .c files in the current directory and link them into an executable (a.out). For this to work, exactly one of the C files must have a main function. If the directory contains any C files that are not referenced by your program, they are still compiled and must not contain syntax errorsor duplicate function names.