Tom Kelliher, CS17
May 16, 1996
void f(int& a, int b)
{
++a;
++b;
}
int main()
{
int i = 0;
int j = 0;
f(i, j);
cout << setw(10) << i << setw(10) << j << endl;
f(1, j);
cout << setw(10) << i << setw(10) << j << endl;
f(i, 1);
cout << setw(10) << i << setw(10) << j << endl;
return 0;
}
int i = 0;
int j = 0;
void f(int& a, int b)
{
++a;
++b;
++i;
}
int main()
{
int a = 10;
int b = 12;
int j = 100;
f(a, b);
cout << setw(10) << a << setw(10) << b
<< setw(10) << i << setw(10) << j << endl;
f(i, j);
cout << setw(10) << a << setw(10) << b
<< setw(10) << i << setw(10) << j << endl;
return 0;
}