Which rule applies to a C++ reference variable?
-
A
It can safely hold a null value
-
B
It occupies no storage whatsoever
-
C
It must be initialised when declared
Correct answer
-
D
It may be rebound to another object
Correct answer
C. It must be initialised when declared
13 views
Explanation
A reference is bound once at initialisation and cannot later be reseated to another object.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ