Virtual function

closed account (9605fSEw)
Can someone explain what virtual function does..i see a class where in the header file...it is decleared like:

virtual bool Read();


how is it different from

bool Read();
virtual is used with methods of classes, not functions.

Ot os part of polymorphism and indicates that the method can be redefined in a descendant class.

See http://www.cplusplus.com/doc/tutorial/polymorphism.html for more info.
Topic archived. No new replies allowed.