Does anyone know of a way to convert a float into a string?
e.g.
float 1.23; BECOMES char Array[4] = "1.23";
Printable View
Does anyone know of a way to convert a float into a string?
e.g.
float 1.23; BECOMES char Array[4] = "1.23";
Something like -
char Array[5];
float a = 1.23F;
sprintf(Array,"%g",a);
itoa() is a non-standard function. sprintf() is standard and if you know how to use printf() then it is easy enough to use.
Thanks Guys,
My stdlib.h dosen't contain ltoa, ftoa, itoa etc. which is why I had the problem.
sprintf() works fine.