// Dick. cs201/lab/04 // Date Sun Apr 23 11:31:41 PDT 1995 // Teaching how functions work /* This program shows you how a functions with reference arguments work. To do this it has special tracing commands that report what it is doing to the special diagnostic output channel "cerr". It also shows that you don't have to store a value before printing it. The calculation is not very exciting.... This is not a very good style because there is no need to use call by reference when only _________________result is returned. */ #include int main( ) { // Main's local variable is int n; //Use the following functions void odd(int&); void half(int&); void dubl(int&);//Experiment a: Delete the & here and in the // function definition of dubl below // and make it compile and run. Does it do // the same things? // If it does put the & back in void trbl(int&); void next(int&); // Start of commands in main n=0; //Experiment b: is this valid here // next(0); cout <<"In main, n is now "<