Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *itoa(int n, unsigned char* str, int base)
- {
- int i=1, j=0, x;
- if(n<0) str[j++] = '-', n = -n;
- for(x=n;x;x/=base) j++;
- for(x=n;x;x/=base) str[j-i++] = x%base + '0' + 39*(x%base>9);
- str[j] = 0;
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment