look up stringstream. However, note that some floats cannot be completely represented by a stream. Therefore, only a "limited" number of digits will appear in the decimal portion of the string. Consider the float representation of 1/3. I'ts 0.3333... where 3 goes on indefinitely. When converted to a string the number of 3s in the float will be truncated.
ostringstream and istringstream are basically the same as cout and cin, but they don't print stuff on screen. So you can use them as "anything_to_string converter" (ostringstream), and "string_to_anything converter" (istringstream).
>Is there a reason not to use strtod( )?
I can only think of one reason, but it's a doozy. strtod works in the wrong direction. The OP wants a conversion from float-point to string, not string to floating-point.
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...