#include #include "shared.h" /* * driver.c -- demonstrates the use of header files, and type qualifiers */ int main ( int argc, char *argv[] ) { // call an exported function by shared.c through shared.h greeting(); // what is the current altitude print_altitude(); // print_altitude is exported through "shared.h" (no compiler warning) // let's go down a bit descend(500.0); // descend is not declared in "shared.h", but we know it is there! (compiler warning) // let's go up now // ascend(500.0); // ascend is declared static (gives compilation error) // where we are now print_altitude(); // wherever we are, let's go up twice as high altitude *= 2.0; // we can meddle with global variables however we like // where we are now print_altitude(); //printf("speed is %g mph\n", speed); // speed is defined in shared.c, but not exported, and is invisible return 0; }