
-----------------------------------
tinhnho
Sat Mar 13, 2004 5:47 pm

c++ please help
-----------------------------------
Hi  everyone

i have a proplem with C++.Here is the question:
Use the class complex  .Write two(2) versions ,a nonmember function friend version and a member function version.BÃ³th them have the binary operator functions add,multiply, and substract.Each should return complex.
Declare three complex objects ,c1, c2 ,c3.Initialize the objects c1,c2 to values of your choice and then print th&#7865;m Invoke each of the overloaded operators(eg., c3= c1+c2 ;)and print the resulting objects c3

Here is the complex function and what i thinking:

#include 
#include 


class complex {
public:
   complex(double r) {real = r ; imag =0;}
   void assign(double r, double i){ real = r; imag = i;}
   void print() { cout c3= 38i + 6

-----------------------------------
tinhnho
Wed Mar 17, 2004 5:38 pm


-----------------------------------
nvm,i got it figure out,thanks alot
