All programs will be tested on department machines (hydra/cetus computers) - be sure your code compiles without warning and runs correctly on these machines.
Your code must compile without warning with the -Wall compiler flag.
You may use other compiler flags as necessary.
Use meaningful variable and function names.
All lines must be 100 characters in length or less (this includes any whitespace at the end).
Choose a level of indentation (number of spaces) you like and use it consistantly (2-to-4 space indentation is common).
Always use braces for your if, while, for, do-while, and switch statements even when they are not required.
If you find yourself copying chunks of code it probably should be a function.
Write small functions. Keep them short and simple. They should represent a single clearly identifiable action and their name should communicate what that action is. Only in rare occations is it necessary to have long functions.
Group related functions together in separate source files.
All functions that will be called from a file other than the one they are written in must be prototyped in a header file (.h) with the same name as the source file (.cpp) they are found in.
All source files (.cpp) must include a header comment that lists all the functions it contains and a brief description of what they are for.
What the function does.
Any restrictions on its input
Any gaurantees about its output
All header files (.h) must clearly document every feature in them.