Re: Probs with g++ and cout
>
> Hello,
>
> since updating to "rex" I've got some problems with C++.
> When I compile this code:
>
> ------8<-------8<---------8<-----------8<--------------8<-----------
> #include <iostream.h>
>
> int
> main()
> {
> double z = 2.00;
> cout << z << " ^2 = " << z * z << endl;
> return 0;
> }
> ------8<-------8<---------8<-----------8<--------------8<-----------
> with
>
> g++ -o prob prob.cc
>
> and then starting with "./prob" I got the following output:
>
> -3.09183e-3832 ^2 = -1.01729e-4265
>
> Did I forget any library? Is there something I should include?
>
> Packages: libc5: 5.4.7-6
> libg++27: 2.7.1-3
> gcc: 2.7.2.1-2
>
> Thanks,
>
> Jonas
>
> --
> /====================================================================\
> | Jonas Rathert | Who is |
> | Mathematisches Institut, Uni Koeln | General Failure ? |
> | EMail: jrathert@mi.uni-koeln.de | And why is he |
> | WWW : http://www.mi.uni-koeln.de/~jrathert/ | reading my disk ? |
> \====================================================================/
>
> --
> TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
> debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com
>
>
Hi,
I get the exactly the same behaviour and results. I included a line using
printf to see what value the variable would contain and it does print 2 so
I assume that the problem would lie in cout.
Luis.
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com
Reply to: