¿¹Á¦

class MyClass {
public:
MyClass (char *nameInput, int twoInput, int threeInput);
private:
char *one;
int two, three;
int four;
};

MyClass::MyClass (char *nameInput, int twoInput, int threeInput) : two(twoInput), one(nameInput), three(threeInput), four(twoInput + threeInput)
{
}


¼Ö·ç¼Ç
Ŭ·¡½º ¸â¹ö¸¦ ¼±¾ðÇÑ °Í°ú °°Àº ¼ø¼­·Î ÃʱâÈ­ÇϽʽÿÀ.

class MyClass {
public:
MyClass (char *nameInput, int twoInput, int threeInput);
private:
char *one;
int two, three;
int four;
};

MyClass::MyClass (char *nameInput, int twoInput, int threeInput) : one(nameInput), 
two(twoInput), three(threeInput), four(twoInput + threeInput)
{
}