I have an abstract base class and a derived class in the header file. Is it possible to have a pure virtual function definition outside a derived class?
For instance:
//file .h class Baseclass { public: virtual int vfunc() = o; //assume Ctor and Dctor }; class Derivedclass : public Baseclass { public: int vfunc(); //assume Ctor and Dctor };
Now in the cpp file:
#include <file.h> int Derivedclass :: vfunc() { // Body of the function }
Is the above method correct / possible?
source share