Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
* VIRTUAL BASE CLASSES got nothing to do with virtual functions , they're made virtual to avoid multiple inheritence problems * VIRTUAL FUNCTIONS are made virtual to provide the polymorphism capabilities of function in the base class pointer calling the last inheriting children function , it uses a vtable to so that * PURE VIRTUAL FUNCTIONS are virtual functions that do not have implementation in the base class but are needed in childrens classes , so to access it from the base pointer you can define them as empty (because they don't have to do nothing in the base class, but they have in the children's classes) , OR make it pure virtual to avoid any problems , and the base classs becomes therefore a prototype(model for the children's classes to implement it functions) that cannot be spawned
1st Dec 2016, 6:55 AM
mekacher anis
mekacher anis - avatar