// Program that tries to get two float values out of a function set_cons // This one fails because of scope // #include void set_cons(void) { float pi, e; pi=3.141593; e=2.718282; cout << "In function set_cons: pi = " << pi << "; e = " << e << endl; } void main(void) { float pi = 0.; // declare pi and set it first to zero float e = 0.; // declare e and set it first to zero cout << "In function main: pi = " << pi << "; e = " << e << endl; // We want to set the correct values of pi and e: set_cons(); // This is NOT going to work: *Scope* error cout << "In function main: pi = " << pi << "; e = " << e << endl; }