class Abstract {
public:
virtual void MyVirtualMethod() = 0;
};
class Concrete : public Abstract {
public:
void MyVirtualMethod() { //do something }};
An object of class Abstract can not be created because the function MyVirtualMethod has not been defined ( the =0 is C++ syntax for the a pure virtual function, a function that must be part of any (derived) class but is not defined in the base class. The Concrete class is a concrete class because it's functions (in this case, only one function) have been declared and implemented.
Search Encyclopedia
|
Featured Article
|