초기화 방법에는 여러가지가 있다.
1. 멤버 초기화
class Init{
public:
int value;
Init(int i): value(i){};
void OutValue(){ cout<< value;}
};
int main(){
int a = 3;
Init i(5);
i.OutValue();
cout<< endl;
return 0;
}
2. 레퍼런스 초기화
초기화 방법에는 여러가지가 있다.
1. 멤버 초기화
2. 레퍼런스 초기화
댓글