// file: lecture_28/example.cc // // local include files // #include "t.h" // define a main program // int main(int argc, char** argv) { // declare a variable of type Toaster::TYPES // /* Toaster::TYPES foo = Toaster::CUISENART; Toaster::TYPES goo = Toaster::BOSCH; fprintf(stdout, "size of TYPES is: %d\n", sizeof(foo)); fprintf(stdout, "the value of %s = %d\n", "foo", foo); foo = (Toaster::TYPES)1; fprintf(stdout, "the value of %s = %d\n", "foo", foo); fprintf(stdout, "the value of %s = %d\n", "goo", goo); goo = Toaster::SUNBEAM; fprintf(stdout, "the value of %s = %d\n", "new_goo", goo); goo = Toaster::BRIEF; fprintf(stdout, "the value of %s = %d\n", "newest_goo", goo); Toaster::BOOL lval = Toaster::FALSE; // declare a string // char* joe = (char*)"joe"; */ /* // declare an object // Toaster bosch; Toaster sunbeam; // set the debug level // bosch.debug_level_d = Toaster::FULL; sunbeam.debug_level_d = Toaster::BRIEF; // print the values of debug_level_d // fprintf(stdout, "%s: address is %d\n", "bosch", &bosch.debug_level_d); fprintf(stdout, "%s: %d\n", "bosch", bosch.debug_level_d); fprintf(stdout, "%s: address is %d\n", "sunbeam", &sunbeam.debug_level_d); fprintf(stdout, "%s: %d\n", "sunbeam", sunbeam.debug_level_d); // call a function // bosch.set_value(99, 99, 99.999); sunbeam.set_value(-1, -1, -1.1111); */ // demonstrate the const operator // const long i = 27; fprintf(stdout, "i = %ld\n", i); i = 35; // exit gracefully // return(0); }