Multiple Files
Multiple Files
Complex programs consist of many files.
To make global variables in one file accessible to another file, use the extern keyword
// in file x.c
int x;
// in file y.c
extern int x;
Both files use the same
copy of x.
Previous slide
Next slide
Back to the first slide
View Graphic Version