//: C03:PassReference.cpp
#include <iostream>
using namespace std;
void f(int& r) {
cout << "&r = " << &r << ", ";
cout << " r = " << r << endl;
r = 5;
cout << "&r = " << &r << ", ";
cout << " r = " << r << endl;}
int main() {
int x = 47;
cout << "&x = " << &x << ", ";
cout << " x = " << x << endl;
f(x); // Looks like pass-by-value,
// is actually pass by reference
cout << "&x = " << &x << ", ";
cout << " x = " << x << endl;} ///:~