Ohh, that's mea culpa... See right code below...
I know that this code is in the public domain because I have wrote it for 5 (or 10

) minutes 22 days ago. So I have got it directly from my VC++ 2008 solution...
/* The Itoa code is in the public domain */
char* Itoa(int value, char* str, int radix) {
static char dig[] =
"0123456789"
"abcdefghijklmnopqrstuvwxyz";
int n = 0, neg = 0;
unsigned int v;
char* p, *q;
char c;
if (radix == 10 && value < 0) {
value = -value;
neg = 1;
}
v = value;
do {
str[n++] = dig[v%radix];
v /= radix;
} while (v);
if (neg)
str[n++] = '-';
str[n] = '\0';
for (p = str, q = p + (n-1); p < q; ++p, --q)
c = *p, *p = *q, *q = c;
return str;
}
Reputation Points: 1234
Solved Threads: 347
Postaholic
Offline 2,001 posts
since Jul 2008