help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: istream problem


From: Ulrich Eckhardt
Subject: Re: istream problem
Date: Mon, 31 Jul 2006 09:21:23 +0200
User-agent: KNode/0.10.2

sharmaharish@gmail.com wrote:
> I am using gcc version 3.4.2 (mingw-special) version compiler and the
> following code is not giving expected output.
> 
> include <iostream>
> using namespaces std;

No surprise, this doesn't even compile. Seriously, you should use
cut'n'paste for code.

> int main() { double d; cin >> d; cout << d; return 0; }
> 
> It gives out a garbage value int output when I give 2.22507e-308 as
> input value to read. 

Your method is flawed, you didn't check if reading said value was
successful. 

However, that has nothing to do with the GCC so please take it to a general
C++ group, e.g. comp.lang.c++.moderated or alt.comp.lang.learn.c++.

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]