Re: istream problem

2006-08-01 Thread Bernd Strieder
Hello, [EMAIL PROTECTED] wrote: > I am using gcc version 3.4.2 (mingw-special) version compiler and the > following code is not giving expected output. > #include using namespace std; int main() { double d; cin >> d; cout << d; return 0; } > > It gives out a garbage value int output when I g

Re: istream problem

2006-07-31 Thread jinxidoru
The first thing I would do is initialize your variable to 0. Then run the program again, if the returned value is zero. Then you know that the cin part is not working. If you still get a weird value, then you are probably exceeding the limits of the double for your compiler. The size of a doubl

Re: istream problem

2006-07-31 Thread Ulrich Eckhardt
[EMAIL PROTECTED] wrote: > I am using gcc version 3.4.2 (mingw-special) version compiler and the > following code is not giving expected output. > > include > using namespaces std; No surprise, this doesn't even compile. Seriously, you should use cut'n'paste for code. > int main() { double d; c

istream problem

2006-07-30 Thread sharmaharish
I am using gcc version 3.4.2 (mingw-special) version compiler and the following code is not giving expected output. include using namespaces std; 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. Re