#include using namespace std; class CoordT{ public: CoordT(int & x): ref{x} { cout << "X is " << ref << endl; ref = 1'000'000; } private: int & ref; }; int main() { int x{99}; int * ptr; CoordT coord(x); ptr = &x; cout << "*ptr = " << *ptr << endl; cout << "ptr = " << ptr << endl; *ptr = 7; cout << "x = " << x << endl; cout << endl << endl; int & ref{x}; cout << "ref = " << ref << endl; ref = -99; cout << "x = " << x << endl; return 0; }