How the C++ polimorphism work with pointers? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How the C++ polimorphism work with pointers?

if I declare a pointer of A, he point to memory for A size. but if the pointer point to B object, who is inherite from A, the size of memory should be bigger?

17th Mar 2017, 3:12 PM
‫ברוך רוטקוף‬‎
‫ברוך רוטקוף‬‎ - avatar
1 Answer
0
Yes, but actually, you shouldn't take care about it. Just use the pointers and compiler will do its work. All pointers themselves have the same size.
30th Mar 2017, 10:41 PM
soman