float x = (float) atof("123.45");Oddly, the atof() -- ascii to float -- returns a double not a float so you have to cast it. Other conversions:
double d = atof("123.45"); // string to double int i = atoi("123"); // string to int long l = strtol("12345", NULL, 10); // string to long unsigned long l = strtoul("12345", NULL, 10); // string to unsigned long