I am doing exercise 2.27 from C++ primer 5th edition and I am confused in this question:
Exercise: Which of the following initializations are legal? Explain why.
(c) const int i = -1, &r = 0;
I came to conclusion that r is illegal because this will be same as below:
const int i = -1;
int &r = 0;
But this github repo suggest that (c) is same as below:
const int i = -1;
const int &r = 0;
So, it contradicts to my answer, please provide me the correct answer.
P.S.: I am begineer in C++ language.