// int &r = 1;
const int &r = 1;
cout << "r is " << r << endl;//output is 1
why const int &r = 1 is legal ? because const? please help me. thanks in advance. this is from C++ Primer 5th Edition exercise 2.27 (c)
// int &r = 1;
const int &r = 1;
cout << "r is " << r << endl;//output is 1
why const int &r = 1 is legal ? because const? please help me. thanks in advance. this is from C++ Primer 5th Edition exercise 2.27 (c)