How to implement " char * ftoa(float num) " without sprintf() library function in C, C++ and JAVA
- by SIVA
Today I appeared for an interview, and the question was writing my own "char * ftoa(float num) " in C, C++ and Java.
Yes, I know float numbers follow IEEE standard while allocating their memory, but I don't know float to char conversion by using Mantissa and Exponent in C.
I don't have any idea to solve the above problem in C++ and JAVA.
I/P to the ftoa(): 1.23
O/P from the ftoa(): 1.23 (char format).
Thanks in advance ...