A simple multi-file program
For this lecture we'll develop a simple project to calculate the
correlation of
some student marks, partitioned into multiple files.
The input data file contans two columns of marks -
from a project marked out of 40, and an exam marked out of 60.
- calcmarks.h -
contains globally visible declarations of types, functions, and variables
- calcmarks.c -
contains main(), checks arguments, calls functions
- globals.c -
defines global variables required by all files
- readmarks.c -
performs all datafile reading
- correlation.c -
performs calculations
|
|
Each C file depends on a common header file,
which we will name calcmarks.h.
CITS2002 Systems Programming, Lecture 17, p4, 26th September 2023.
|