#include <iostream>
using namespace std;
class A{
public:
static int x;
static A y;
A();
~A();
};
A::A() {
y.x++;
}
A::~A()
{
y.x--;
}
A A::y=*new A;
int A::x=5;
void main(){
A a;
A b;
cout<<a.x<<endl;
cout<<b.x<<endl;
}
hello guys
i camt understand this code .... what does it mean to do this (
A A::y=*new A;
int A::x=5;
) and what's the point of having a static object of the class in side it ....
even after watching the variables ... i couldnt understand this
any help please .. :'(