char* Itoa(int n, char *p, int m) { int a[56] = {0}; int i = 0; int j = 0; while(n >= 1) { int nI = n/m; a[i++] = n - nI*m; n = nI; } while(i--) { p[j++] = a[i] + 48; } p[j] = '\0'; return p; }