You must have forgotten to include the header file "stdlib.h" or maybe you used ""atoi"" by mistake instead of ""atof""
The below code works fine for me --
#include<stdio.h>
#include<stdlib.h>
main()
{
char *str="111.25";
float x;
x=atof(str);
printf("x=%f\n",x);
}
Output :
x=111.250000