가 그것을 필요, 정적 데이터 멤버가 클래스의 복사 생성자, 소멸자 및 연산자 =, 나는 컴파일러는 우리를 위해 하나를 구축 할 것을 읽을 수없는 포인터클래스 기본 운영
class myClass{
int dm;
public:
myClass(){
dm = 1;
}
~myClass(){ } // Is this line usefull ?
myClass(const myClass& myObj){ // and that operator?
this->dm = myObj.dm;
}
myClass& operator=(const myClass& myObj){ // and that one?
if(this != &myObj){
this->dm = myObj.dm;
}
return *this;
}
};
을 가지고 있으므로 그것을 (연산자를 업데이트해야하는 데이터 멤버를 추가 할 때)
'int dm'은 정적 데이터 멤버가 아닙니다. 'static int dm'은 일종의 전역 변수가 될 것입니다. – Potatoswatter