Используя sscanf, мы можем преобразовать строку в число с плавающей точкой.
#include<stdio.h>
#include<string.h>
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;
}