| | int ivalue1=1; // incomplete file do not compile.void main( ){ // references the ivalue1 defined above extern int ivalue1; // default initialization of 0, ivalue2 only visible // in main( ) static int ivalue2; // stored in a register (if available), initialized // to 0 register int rvalue = 0; // default auto storage class, int_value3 initialized // to 0 int int_value3 = 0; // values printed are 1, 0, 0, 0: cout << ivalue1 << rvalue \ <<ivalue2 << int_value3; function_a( );}void function_a(void){ // stores the address of the global variable ivalue1 static int *pivalue1= &ivalue1; // creates a new local variable ivalue1 making the // global ivalue1 unreachable int ivalue1 = 32; // new local variable ivalue2 // only visible within function_a static int ivalue2 = 2; ivalue2 += 2; // the values printed are 32, 4, and 1: cout << ivalue1 << ivalue2 \ << *pivalue1);} | | |