CITS2002 Systems Programming |
← prev | next → | CITS2002 | CITS2002 schedule | |||
Providing our variable definitionsIn the C file globals.c we finally define the global variables. It is here that the compiler allocates memory space for them. In particular, we now define the size of the projmarks and exammarks arrays, in a manner dependent on the preprocessor constants from calcmarks.hThis allows us to provide all configuration information in one (or more) header files. Other people modifying your programs, in years to come, will know to look in the header file(s) to adjust the constraints of your program.
Global variables are automatically 'cleared'By default, global variables are initialized by filling them with zero-byte patterns.This is convenient (of course, it's by design) because the zero-byte pattern sets the variables (scalars and arrays) to:
CITS2002 Systems Programming, Lecture 17, p6, 26th September 2023.
|