converting from string to float/int

hi guys, my english is not so well, i'll try my best to explain

i'm working on a small program that receives a std::string from the user like this:

"GE:0.6 Po:0.16 A:32567890-in h=478 So:CND Bo:1.02 BSYW:61 PTFPD=125000 FI:30/10/10"

i extracted the values from the string with subst but then i need to use those values to work with them, the problem i cant solve is how to convert to float or int.

the specificactions of the project are very restrictive and it most be compiled only with cygwin g++ which doeesn't include stringstreams libraries
use sscanf maybe? (from cstdio)
If you already have the code to pull out each token as a substring, then you can just use functions like strtod or strtol from cstdlib to convert. Just use c_str() function of string to pass to conversion functions as char*.
Topic archived. No new replies allowed.