Q:

Unlike an ordinary reference, a reference to const cannot be used to change the object to which the reference is bound

0

Unlike an ordinary reference, a reference to const cannot be used to change the object to which the reference is bound.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const int ci = 1024;
const int &r1 = ci; // ok: both reference and underlying object are const
r1 = 42; // error: r1 is a reference to const
int &r2 = ci; // error: non const reference to a const object

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now