happy to be of service
just be careful not to overflow the buffer.
using sprintf, without input verification, might cause a buffer overrun bug and possibly a security threat.
so if you allocate a buffer of 50 chars, make sure that the number isn't bigger than 50 digits.
another option a bit more complicated and not necessarily better is to dynamically allocate the memory according to the size of the input.
only problem is the question of who needs to free the memory.
if that is not a problem for you, you might want to choose the latter option.
cheers.