How to convert a number to C string

Unfortunately in embedded systems sometimes it is not feasible to use strtol function to convert an integer to c string. Using the following C function you will be able to convert any string to an integer number. Although it is not an optimal solution but it will help you solve this kind of problem. Beware that this function is using dynamic memory allocation. Updated Version Here (Please do not hesitate to provide any better alternative method)