Copy Constructor #복사 생성자

· C/C++
1. 정의복사 생성자-> '값'이 복사되는 것임.같은 값을 갖는 여러 Object, Instance 생성시 유용. 2. 구문const student &s 처럼 const reference사용 (원본의 data를 변경할 일은 없기 때문에) 3. 예제12345678910111213141516171819202122232425262728293031323334353637383940414243 #include using namespace std; class student{ private: int score; string name; public: student(){ //Default Constructor this->score = 0; this->name = " "; } student(string name, int s..
M_Falcon
'Copy Constructor #복사 생성자' 태그의 글 목록