C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 3)
3.
Which of the following statements is correct?
Base class pointer cannot point to derived class.
Derived class pointer cannot point to base class.
Pointer to derived class cannot be created.
Pointer to base class cannot be created.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
41 comments Page 2 of 5.

Kazi Ameen said:   10 years ago
It is just because of the top-down approach.

Thazaar said:   10 years ago
It is a top down approach. So derived class pointer cannot point to the base class.

Divya said:   1 decade ago
Why D is not correct? Is we create pointer for base class?

Sandep said:   1 decade ago
There points and all the doubts will be cleared.

1) in top-down approach will can't do up casting where as reverse is possible.

2) As derived class has inherited there is no need for pointing to the base class object.

3) In top-down approach the derived class does not no about the base class do pointing to the base class is not possible using the pointer of derived class.

Prashant said:   1 decade ago
Then what is up casting?

Priya said:   1 decade ago
Derived class is the class already inherited from base class. So, there is no need for derived class to point the base class. As I thought so.

Wele Suda said:   1 decade ago
@Deepak.

Take NO, C++ is OO language, so it has bottom-up approach, not top-bottom.

Jyothi said:   1 decade ago
Being a static cast basic class have can assign base class pointer to derived class pointer.

Lav kumar said:   1 decade ago
Derive class is the derived one and there is no link with the base class there.

Bhavna said:   1 decade ago
Derived class is a child class and base class is like parent to that.


Post your comments here:

Your comments will be displayed after verification.