Converting a string with a decimal to a float

Hi, I can convert strings to an int easy enough using:

string stringVar = "55.33" ;

int x = atoi(stringVar.c_str());

but if will only return 55, how can I convert the string so it contains the decimal point? and returns 55.33 ?

Cheers,

Ben
Last edited on
Too hasty in posting , played around and got it working with

float f = atof(stringVar.c_str());
Topic archived. No new replies allowed.