#include using namespace std; void Square( double & out, double x ) { out = x * x; // Store result in output variable } int main(int argc, char ** argv ) { double a, b; a = 4.0; Square( b, a ); // b is passed by reference and can be modified by // the method so that the result can be returned cout << "a = " << a << " --- squared = " << b << endl; }