Pointer version of itoa
The standard version of itoa takes a parameter named base (which you have assumed is 10).

You probably don't need a second hidden function; this would do instead:

if (n &lt; 0)
{
    *s++ = '-';
    n = -n;
}
// ... itoa implementation continues here ...


Recursing is clever; you could also probably do it with two loops instead (untested code ahead):

i = 1;
while ((i * 10) &lt;= n)
    i *= 10;
for (; i != 0; i /= 10)
{
    int x = n / i;
    *p++ = (char)(x % 10 + '0');
    n -= (x * i);
}
assert(n == 0);