1/24/00
COM1100 Winter2000 Lecture 7
21
How many mistakes ?
nvoid Increment(int& n); // function declaration 
n     void Increment(int& n){ // function definition
n n = n+1;
n };
n    int main() {
n int x = 25;
n cout << x << " ~~~ " << Increment(x) << Increment(6) << endl;
n return 0;
n}
nIncrement(x) : the function call does not result in any usable data value and so cannot be used in any computation or in the output stream.
nIncrement(6) : cannot convert parameter 1 from 'const int' to 'int &'