1.

Why references are different from pointers?(a) A reference cannot be made null(b) A reference cannot be changed once initialized(c) No extra operator is needed for dereferencing of a reference(d) All of the mentionedThis question was addressed to me during a job interview.My doubt stems from OOPs Concept topic in division Basics Concepts of C++ of C++

Answer»

The correct answer is (d) All of the mentioned

Easiest EXPLANATION - References cannot be made null whereas a pointer can be. References cannot be changed whereas pointers can be modified.

 Pointers need * operator to dereference the VALUE PRESENT INSIDE it whereas reference does not need an operator for dereferencing.



Discussion

No Comment Found

Related InterviewSolutions