class A { public: static A* getA(); private: static A* m_pA; }; A* A::getA() { return m_pA; } int main(int argc, char* argv[]) { return 0; }
A* A::getA() { return m_pA; }
int main(int argc, char* argv[]) { return 0; }
이게 왜 컴파일이 안될까요 ?? c++을 오랜만에 해서일까요 ?
에고 챙피...
static 변수는 다음과 같이 바깥에서 선언을 해 줘야 합니다.
A* A::m_pA(something);
- 토끼군
static 변수는 다음과
static 변수는 다음과 같이 바깥에서 선언을 해 줘야 합니다.
A* A::m_pA(something);
- 토끼군