// File: ref1.cpp // // using references #include using namespace std ; main() { int x = 3, y = 9 ; int& ref = x ; // initialize reference cout << "x = " << x << ", ref = " << ref << "\n" ; x = 5 ; cout << "x = " << x << ", ref = " << ref << "\n" ; ref = 7 ; cout << "x = " << x << ", ref = " << ref << "\n" ; ref = y ; cout << "x = " << x << ", ref = " << ref << "\n" ; }