Possible Duplicate:
string to float conversion?
how can i convert a string to float in c with only Libc?
Possible Duplicate:
string to float conversion?
how can i convert a string to float in c with only Libc?
char *float_str = "10.5";
double d = atof(float_str);
or
char *float_str = "10.5";
double d = strtod(float_str, (char **) NULL);
(The second form is recommended for newer code, as atof is deprecated in favor of strtod.)
It's in the stdlib.h header.
strtod/strtof is the way forward..http://www.gnu.org/software/libc/manual/html_mono/libc.html#Parsing-of-Floats
particularly strtod, strtof
correct link...