From: (Andrew Laing) Newsgroups: comp.os.msdos.djgpp Subject: Re: Newbie questions Date: Wed, 21 Jan 1998 02:32:00 GMT Message-ID: <34c55dec.5740948@news.demon.co.uk> References: <6a391k$896$1 AT talia DOT mad DOT ibernet DOT es> NNTP-Posting-Host: goajl.demon.co.uk Lines: 48 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 20 Jan 1998 23:40:45 +0100, "Inyaki Rodríguez" <0115561c01 AT abonados DOT cplus DOT es> wrote: >Hi, I'm a newbie with C++ and I want to work with class Complex but I have >some questions. >I had write this sample program: > >#include >#include >int main(void) >{ > Complex z1; > Complex z2; > z1=complex(1,1); > z2=complex(1.5,3); > cout << "z1+z2= " << z1+z2 << "\n"; > cout << "z1*z2= " << z1*z2 << "\n"; > cout << "z1/z2= " << z1/z2 << "\n"; > return 0; >} Try rewriting it like this : #include #include int main(void) { float_complex z1(1,1); float_complex z2(1.5,3); cout << "z1+z2= " << z1+z2 << "\n"; cout << "z1*z2= " << z1*z2 << "\n"; cout << "z1/z2= " << z1/z2 << "\n"; return 0; } It should now compile without any problems. I recommend having a look at the header files relating to complex arithmetic in the lang\cxx\std directory if you get stuck again. Hope this helps! Regards Andrew Laing.