{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chapter09

# Cpp 29 complex

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; ; y.ShowComplex(); cout<<"-------------------------------- \n" ; y=x; cout<<" x => " ; x.ShowComplex(); cout<<" y => " ; y.ShowComplex(); cout<<"--------------------------------- \n" ; y.SetComplex(30, 40); cout<<" x => " ; x.ShowComplex(); cout<<" y => " ; y.ShowComplex(); } - 18 - IT COOKBOOK [실습하기 9-4] 객체의 값에 의한 전달 방식의 함수 작성하기 [예제 9-4] 9_4.cpp 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include<iostream> using namespace std; class Complex { private : int real; int image; public : Complex( int r=0, int i=0); void ShowComplex() const; void SetComplex(int r=0, int i=0); }; Complex::Complex(int r, int i) { real=r; image=i; } void Complex::ShowComplex() const { cout<<"( " <<real <<" + " <<image << "i )" <<endl ; } - 19 - IT COOKBOOK [실습하기 9-4] 객체의 값에 의한 전달 방식의 함수 작성하기 [예제 9-4] 9_4.cpp 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 void Complex::Set...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern