Which statement about a C++ reference is correct?
-
A
It can be left uninitialised
-
B
It can be reassigned to another variable later
-
C
It stores a copy of the object
-
D
It must be initialised and cannot be rebound
Correct answer
Correct answer
D. It must be initialised and cannot be rebound
17 views
Explanation
A reference is an alias that must be bound at declaration and cannot be rebound afterwards.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ