base base derived derived

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 11-5] Add 클래스에 생성자 정의하기 11[예제 11-5] 11_5.cpp 24 25 class Add : public Calc{ 26 public : 27 void Sum(); 28 Add(int new_A, int new_B); 29 }; 30 31 void Add::Sum() 32 { 33 c=a+b; 34 } 35 36 Add::Add(int new_A,int new_B) 37 { 38 a=new_A; 39 b=new_B; 40 c=0; 41 } 42 43 void main() 44 { 45 Add y(3, 5); 46 y.Prn(); 47 } - 21 - IT COOKBOOK 2) 상속관계에서의 생성자 IT COOKBOOK 상속 상속 관계에서 생성자 문제 - 22 - 2) 상속...
View Full Document

Ask a homework question - tutors are online