• 추천글
  • 최신글
  • 검색범위
  • ( 3 건)
1
이전 다음 이미지있는 글만 보기
  • [C++] Copy Constructor (복사 생성자)
  • Kani Style| 08.05.23 00:02
  • /* 다음과 같은 Date클래스를 구현해보자.*/ int main(){ Date d1(2007, 3, 4); Date d2 = d1; d1.OutDate //2007/3/4 d2.OutDate //2007/3/4 return 0;}──────────────▷Date.h Date(Date void OutDate() const; private:int year,.....
  • Destructor가 왜 2번 불리는 거죠?
  • Extremely Agile| 07.12.12 11:56
  • 오늘 같이 일하는 분들 중 가운데 한분으로부터 왜 제 프로그램을 실행시키면 destructor가 2번 불리는 거죠?라는 질문을 들었습니다.소멸자는 명시적으로 불러주지 않는 한 (뭐 가령 obj.TheClass::~TheClass()와 같이 해 주지 않는 한) 절대로 두 번 불리지 않습니다......
  • Copy constructor
  • ons*tory| 07.11.09 12:51
  • // 객프 실습9주차 class Time {public:Time { cout Time (int x, int y) { cout/// Adding Copy Constructor///Time (const Time t) { cout /*p = new int[2]; p[0] = t.p[0]; p[1] = t.p[1];*/}...