#include <iostream>
#include <stack>
#include <queue>
using namespace std;
class A{
int bbb;
public:
static A* a;
static A* getA(){
if(a == NULL)
a = new A();
return a;
}
A(){
cout << "test" << endl;
bbb = 0;
}
void setB(int _b){
bbb = _b;
}
int getB(){
return bbb;
}
};
A* A::a = NULL; // 이렇게 안하면 외부참조오류가 발생합니다.
void main()
{
A* b = A::getA();
cout << "test b: " << b->getB() << endl;
b->setB(555);
A* c = A::getA();
cout << "test c: " << c->getB() << endl;
}