#include #include int main() { char s[100] =\"4.0800\" ; printf(\"float value : %4.8f\\n\" ,(float) atoll(s)); return
By using sscanf we can convert string to float.
#include #include int main() { char str[100] ="4.0800" ; const char s[2] = "-"; char *token; double x; /* get the first token */ token = strtok(str, s); sscanf(token,"%f",&x); printf( " %f",x ); return 0; }