10. class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. classㅣ...
TRANSCRIPT
![Page 1: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/1.jpg)
![Page 2: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/2.jpg)
2
10. Classㅣ Practice 1 10. Classㅣ Practice 1
2
![Page 3: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/3.jpg)
3
10. Classㅣ Practice 1
3
10. Classㅣ Practice 1
// ch10_p01.cpp #include <iostream> #include <Fraction.h> int main() { CFraction fraction; cout << "The fraction object was created successfully." << endl return 0; }
// Fraction.cpp #include <Fraction.h> CFraction:: CFraction ( void ) { m_nNumerator = 0;// 분자 m_nDenominator = 1;// 분모 }
// Fraction.h class CFraction { Private: int m_nNumerator;// 분자 int m_nDenominator;// 분모 public: CFraction( void ); };
![Page 4: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/4.jpg)
4
10. Classㅣ Practice 1
4
10. Classㅣ Practice 1
![Page 5: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/5.jpg)
5
10. Classㅣ Practice 1
5
10. Classㅣ Practice 1
![Page 6: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/6.jpg)
6
10. Classㅣ Practice 1
6
10. Classㅣ Practice 1
![Page 7: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/7.jpg)
7
10. Classㅣ Practice 1
7
10. Classㅣ Practice 1
주의
![Page 8: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/8.jpg)
8
10. Classㅣ Practice 1
8
10. Classㅣ Practice 1
![Page 9: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/9.jpg)
9
10. Classㅣ Practice 1
9
10. Classㅣ Practice 1
int main() { CFunny fn1(4); fn1.Print(); CFunny fn2; cin>>fn2.m_nNum; fn2.Print(); CFunny fn3(fn2); fn3.Print(); return 0; }
CFunny:CFunny( int nNum ) { m_nNum = nNum; } CFunny:~Cfunny{ void } { } void CFunny:Print( void ) const { m_nNum = 1; cout<<m_nNum<<endl; }
class CFunny { private: int m_nNum; public: CFunny( int nNum ); ~Cfunny{void}; void Print( void ) const; }//class CFunny
![Page 10: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/10.jpg)
10
10. Classㅣ Practice 1
![Page 11: 10. Class - khu.ac.krhaptics.khu.ac.kr/aoop/lab03_ch10_part1.pdf · 2014. 8. 11. · 3 10. Classㅣ Practice 1 // ch10_p01.cpp #include #include](https://reader035.vdocument.in/reader035/viewer/2022071002/5fbf5476880e237d4d5db21c/html5/thumbnails/11.jpg)
11
10. Classㅣ Practice 1
초기화 상태
주의 : 띄어 쓰기 없음