// Program that tries to get two float values out of a function set_cons // This one works, but is usually NOT ALLOWED // #include float pi, e; // MUST GET PERMISSION FOR A GLOBAL DECLARATION void set_cons(void) { pi=3.141593; e=2.718282; cout << "In function set_cons: pi = " << pi << "; e = " << e << endl; } void main(void) { pi=0.; // set pi to zero e=0.; // set e 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 going to work: global scope cout << "In function main: pi = " << pi << "; e = " << e << endl; }