目的が変わってる件。

http://codepad.org/Tek23I9z こういうふうに流用できる

/* じつは uitoa */
char *itoa( const unsigned int num ,char* buf, const int i2toka8toka10toka16)
{
  const char table[] = "0123456789abcdef";
  char *p = buf;
  int tmp;

  for(tmp=num;tmp>0;tmp /= i2toka8toka10toka16) *p++;
  *p='\0';
  for(tmp=num;tmp>0;tmp /= i2toka8toka10toka16) *--p=table[tmp%i2toka8toka10toka16];

  return buf;
}

int main()
{
  char buf[4][99];
  int aho;

  for(aho=1; aho<500; aho++){
printf("%d - %s - %s - %s - %s \n",aho
, itoa(aho,&buf[0][0],2)
, itoa(aho,&buf[1][0],8)
, itoa(aho,&buf[2][0],10)
, itoa(aho,&buf[3][0],16)
 );
  }
  return 0;
}

1 - 1 - 1 - 1 - 1
2 - 10 - 2 - 2 - 2
3 - 11 - 3 - 3 - 3
4 - 100 - 4 - 4 - 4
5 - 101 - 5 - 5 - 5
6 - 110 - 6 - 6 - 6
7 - 111 - 7 - 7 - 7
8 - 1000 - 10 - 8 - 8
9 - 1001 - 11 - 9 - 9
10 - 1010 - 12 - 10 - a
11 - 1011 - 13 - 11 - b
12 - 1100 - 14 - 12 - c
13 - 1101 - 15 - 13 - d
14 - 1110 - 16 - 14 - e
15 - 1111 - 17 - 15 - f
16 - 10000 - 20 - 16 - 10
17 - 10001 - 21 - 17 - 11
18 - 10010 - 22 - 18 - 12

あ マイナス符号は扱えないわ。二進のとき面倒なんで unsigned int にしとこ。。。