// Program that tries to get two float values out of a function set_cons // This one fails because of the default "pass-by-value" mechanism // #include void set_cons(float pi, float 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(pi, e); // This is NOT going to work: *pass-by-value* error cout << "In function main: pi = " << pi << "; e = " << e << endl; }