// CS304P Lab 4 Problem KST Learning #include #include using namespace std; class Pyramid { private: static int Pcount; public: Pyramid() { cout << "Pyramid Constructor Called\n\n"; Pcount++; } ~Pyramid() { cout << "\n\nPyramid Destructor Called"; Pcount--; } int get_Pcount() { return Pcount; } }; int Pyramid::Pcount = 0; main() { Pyramid *P1 = new Pyramid; Pyramid *P2 = new Pyramid; Pyramid *P3 = new Pyramid; cout << "\n\nTotal Objects: " << P1 -> get_Pcount(); delete P1; delete P2; cout << "\n\nTotal Objects: " << P3 -> get_Pcount(); getch(); return 0; }