+ 2

Whta is " Pointers to derived classes " in c++ " ? Please give me a better understandable definition.

why we use it ? i read that any three classes like A,B,C . B inherits A publicly and C is inherits A and B both publicly and we give address of class C's object to the object of the class A and when we access the properties of class C through class A's object then class C not permit to class A's object to access it's own property. if we can't do like this despite have address of any object then why we use this functionality ? what it's benefits ?

7th Feb 2017, 3:47 PM
Fazle Rasool Rizvi
Fazle Rasool Rizvi - avatar
1 Respuesta
+ 1
In fact this fonctionality is called polymorphisme and its benefit is when we want to create a set of values of A, B and C and group them in the same set or array, so we can do A * array [10]; and specify which of them is A, B or C
11th Feb 2017, 6:18 AM
Amine M. Boulouma
Amine M. Boulouma - avatar