Does anyone know of a way to convert a float into a string?
e.g.
float 1.23; BECOMES char Array[4] = "1.23";
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);
zen
itoa() is a non-standard function. sprintf() is standard and if you know how to use printf() then it is easy enough to use.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Thanks Guys,
My stdlib.h dosen't contain ltoa, ftoa, itoa etc. which is why I had the problem.
sprintf() works fine.