First of all your function is not set up to return a const char. You need to declare it thusly:
Code:
const char *ftostr(float dVar) {...}
Secondly, you are returning a pointer to a local variable "ans". Notice how you have declared ans in the scope of that function. This means that once the function has returned, the pointer will no longer be valid. That's why the compiler warns you.

BJW