C Style Guide
C programs you write for COMP2303/7306 should follow the following style guide:
- COMP2303 C Programming Style
Guide v1.4 (
25kB)
Whilst many different styles are possible, this minimal style guide has been chosen so that you get used to writing code to a style guide (many companies have one, many style guides are a lot more prescriptive than this); and so that tutors can more easily read and mark your code for assignments.
Useful Links
- The Stanford CS Education Library contains useful educational material on C and other languages. Including...
- Local copy of Pointer Fun with Binky (14MB AVI). (This is document 104 in the Stanford CS Education Library - please see cslibrary.stanford.edu for this video, its associated documents, and other free educational materials.)
- Code Modularity and the C Programming Language (Monash University)
C Tutorials
- Introduction to C Programming by Rob Miles (94 pages, 371kB PDF)
-
These tutorials are taken from CSSE1000 and modified to suit a
UNIX environment:
- C Tutorial One - Introduction
- C Tutorial Two - If Statements, Loops and Expressions
- C Tutorial Three - Functions, Arrays & Strings
- C Tutorial Four - Preprocessor
- C Tutorial Five - Structures and Pointers
- C Tutorial Six - Other Features of C
- Answers to the exercises in these tutorials are available. You are encouraged to attempt the exercises before you look at the answers.
Debugging
A separate page of debugging resources is available.
Reference material
- Textbook by Harbison and Steele
- Textbook by Kernighan and Ritchie
- Online C reference manual (by Martin Leslie)
