CITS4407 Open Source Tools and Scripting  
prev
next CITS4407 help4407 CITS4407 schedule  

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.

 


CITS4407 Open Source Tools and Scripting, Week 9, p4.