cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Stringstream gives me floats when I crea
Stringstream gives me floats when I create it with a 'double number???'
Jul 11, 2011 at 4:27pm UTC
tonnot
(335)
I have a function that use stringstream to parse strings to a numerical values.
stringstream conversor_string_number;
double My_d;
conversor_string_number.str("123456.1234567");
conversor_string_number>>My_d;
conversor_string_number.str("123.1234567");
conversor_string_number>>My_d;
Ok I have 123456 and 123.123 ????????
Whats happen ?
Have to define something ? flags ?
Thanks
Jul 11, 2011 at 6:07pm UTC
ne555
(10692)
[co
de]
"Please use code tags"
[/co
de]
Ok I have 123456 and 123.123 ????????
¿how do you know? probably you are not outputting the value with enough precision.
Jul 11, 2011 at 6:10pm UTC
tonnot
(335)
Yes, your right !!
Topic archived. No new replies allowed.