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 3 of 5.

Ashwini said:   1 decade ago
To give derived class pointer to base class object will be down_casting.

And compiler doesn't allow to downcast any pointer.

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

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

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

Wele Suda said:   1 decade ago
@Deepak.

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

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.

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

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.

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

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


Post your comments here:

Your comments will be displayed after verification.