#ifndef z #define z class shapes{ protected: int area; public: shapes():area(-1){} void setArea(const int x){ area = x; } int getArea()const{ return area; } // if used, no polymorphism: //void print(){cout << "shapes print"<< endl;} // if used, base class can not be instantiated //virtual void print()=0; // if used, base class can be instantiated, polymophism works virtual void print(){cout << "non pure" << endl;} }; #endif