Skip to main content

Object Oriented Programming

A derived class must specify the class(es) from which it intends to inherit. It does so in a class derivation list, which is a colon followed by a comma-separated list of base classes each of which may have an optional access specifier.

In C++, dynamic binding (sometimes known as run-time binding) happens when a virtual function is called through a reference (or a pointer) to a base class.

Any nonstatic member function, other than a constructor, may be virtual.

The virtual keyword appears only on the declaration inside the class and may not be used on a function definition that appears outside the class body.

A function that is declared as virtual in the base class is implicitly virtual in the derived classes as well.