1.

Which of the following is correct?(a) Base class pointer object cannot point to a derived class object(b) Derived class pointer object cannot point to a base class object(c) A derived class cannot have pointer objects(d) A base class cannot have pointer objectsThe question was asked in class test.I want to ask this question from OOPs Concept topic in division Basics Concepts of C++ of C++

Answer»

Right OPTION is (b) Derived class pointer object cannot point to a base class object

Best EXPLANATION: C++ does not allow a derived class pointer to point a base class pointer whereas Base class can point to a derived class object. Both base class and derived class can have pointer OBJECTS.



Discussion

No Comment Found

Related InterviewSolutions