#include void myfunc (double la, double lb, double &lc) { // a and b are parameters called by value, c is called by reference double x = 2 * la; // x is a local variable, only available in this function lb = x; lc = x; } main () { double a = 3; double b = 0; double c = 0; myfunc (a, b, c); // call the function c and lc are identified // a is copies into la, b is copied into lb cout << a << "\t" << b << "\t" << c << "\n"; // this will print 3 0 6 }