[Solved] Converting an int to string without using library functions in C? [closed]


You can achieve this by extracting each bits one by one, like this

str[i] = (char)( (num % 10) - 48 )

48 has to be subtracted because an integer value changing to character goes through an ASCII conversion. Keeping the above line in a loop, that would run for each digit in the number, should do the trick..

2

solved Converting an int to string without using library functions in C? [closed]