![]() |
|
#1
|
|||
|
|||
Operator OverloadingI am writing a program where i want to overload the multiplication operator to enable multiplication of two complex numbers as in algebra:
(a+bi)*(c+di) =(ac-bd)+(ad+bc)i Here's what i've tried so far: CPP / C++ / C Code:
Thanks Last edited by LuciWiz : 15-Sep-2009 at 11:53.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Operator OverloadingSo.....what seems to be the problem?
|
|
#3
|
|||
|
|||
Re: Operator Overloadingi cant get the program to compile. I want atleast some ideas on how to modify it.
|
|
#4
|
|||
|
|||
Re: Operator OverloadingIf I understand you correctly, you did not write the Complex class that resides in Complex.cpp and Complex.h? You simply want to use it and modify it. I would start with something like:
CPP / C++ / C Code:
Then, tell us what errors the compiler is reporting to you. After we get all of the errors taken care of and can get a clean compile, we can start to modify the class. |
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The