#include #include #include using namespace std; //myClassArrayStaticMember1.cpp // class Base { private :int pvtn1; static int x; public: Base() { cout<<"\n default "<< x++; } Base(int n1) { pvtn1 = n1; cout<<"\n \t\b integer constructor : " ; integer( n1); } void integer(int i) { cout<<" \t Base " << i; } ~Base();// signature of destructor }; // static member should be defined ouside base {} int Base::x = x++; //defineing destructor Base::~Base() { cout<<"\n destroyed Base";} class Modulator { // creating array of class instance private: Base b1[3], b2; int x_m[3]; public : Modulator() { for(int i=0; i<3 ; i++) { x_m[i]= i; cout<<"\n Modulator : " << x_m[i]; //call integer method b1[i].integer(i); } } }; int main() { Modulator m1; return 0; }