Earlier quoted context omitted.
Implement: itoa
I don't know the answer of this question. I could do a guestimate on how such thing would work, but I've never coded c/c++ extensively. Am I useless now? I don't really see how this proves someone has basic knowledge about programming. However I could be wrong and this is a function that c/c++ programmers write on a daily base and is indeed a good indicator if someone ever ran a c++ compiler.
Coincidentally, I was asked this exact question in a phone interview this week. I didn't have to give exact code, I just walked through the principal of it (loop for each digit, dividing by the radix each time using the leftover specify the character (can be a lookup in an array), possible to use bit shifting in base 2/8/16 situations).