Originally Posted by
Swoorup
Because I have to limit the memory as far as possible. Only a byte is to be passed and output of two characters are needed.
(...)
Furthermore the numbers are only 0 to 63.
In that case, you should do something like this:
Code:
/* Converts integer number in range [0, 63] to its numeric decimal string
* representation, storing the result in a char array without null termination.
*/
void integerToCharArray(byte number, char* result) {
result[0] = (number / 10) + '0';
result[1] = (number % 10) + '0';
}