This is the first error of several. If you could explain to me what I am doing wrong here I can continue to debug the rest on my own
Here is the main code.
Here is the prototype and function definitonCode:using namespace std; #include "complexh.hpp" int main() { Complex a(3.0,4.0); // instantiate a Complex c; cout << "Enter a complex number (q to quit):\n"; while (cin>>c) // error here { cout << "c is " << c << endl; cout << "complex conjugate is " << ~c << '\n'; cout << "a+c is "<< a+c << endl; cout << "a-c is "<< a-c << endl; cout << "a*c is "<< a*c << endl; cout << "2*c is "<< 2*c << endl; cout << "Enter a complex number (q to quit):\n" } cout << "Done!\n"; system("PAUSE"); return 0; }
Code:friend ostream & operator>>(ostream & os,const Complex & n); ostream & operator>>(ostream & os,const Complex & n); { cout << "real:"; os >> n.rel; cout << endl; cout << "imaginary:"; os >> n.imaginary; cout << endl; return os; }



LinkBack URL
About LinkBacks


