What\'s the difference between the following two declarations?
virtual void calculateBase() = 0;
virtual void calculateBase();
I read the fir
The first one is a "pure virtual" - it will make the class abstract, attempting to instantiate it will result in compiler errors. It is meant to be used as a base class where the derived class implements the necessary behaviour by implementing the pure virtual function. You do not have to implement the function in the base class, though you can.
This is a pattern often used for two design patterns:
The second declaration is just an ordinary virtual member function declaration. You will get compiler errors if you fail to implement the member function in the base class. It is still virtual which implies that it may be useful to override the behaviour in a derived class.