#include<stdio.h>
#include<ctype.h>
#define SIZE 1000
double my_atof(char const *str)
{
float ret = 0;
float temp = 0;
int sign = 0;
while(isspace(*str))
str++;
if(*str == '-')
{
sign = -1;
str++;
}
else
{
sign = 1;
}
while(isdigit(*str))
{
ret = ret * 10 +(*str-'0');
str++;
}
while(*str != ' ')
{
NULL;
str++;
}
while(isdigit(*(--str)))
{
temp = temp / 10 +(*str-'0');
}
temp = temp / 10;
return sign * (ret + temp);
}
int main()
{
float number;
char *string = "35.00001";
number = my_atof(string);
printf("%f
",number);
return 0;
}