#include<iostream>
using namespace std;
static int x = 0;
class Parent{
public:
Parent(){
x++;
}
};
int main(){
Parent p;
cout<<"I am object no "<<x<<endl;
Parent n;
cout<<"I am object no "<<x<<endl;
Parent a;
cout<<"I am object no "<<x<<endl;
Parent b;
cout<<"I am object no "<<x<<endl;
Parent c;
cout<<"I am object no "<<x<<endl;
Parent d;
cout<<"I am object no "<<x<<endl;
}
Comments
Leave a comment