i want to convert int to char
* in C without using itoa()
function.
Because on my Linux Systems i itoa
function is not there. i am using this code which i found from here
I want to run this function on Embedded devices also which are using Linux.
So i am looking for without use of itoa
.
I dnt want to use sprintf
also because its uses for just prints.
So any body please help me to figured out this problem.
Thanks
Here is a simple snippet you can use. There are more elegant and advanced ways, but this gets the job done.
In embedded projects in the past, I have measured this to be approximately 1000 times more efficient than sprintf(). This code is also MISRA-C compliant.
Thing is
snprintf
is the perfect function for this:I find an implemantation of itoa from this link. Maybe it helps you as it did for me.
I found solution regarding this..
I am Happy to and i want which i expected.