static char *Dec2N(int num, int n)
{
static char hexBuf[sizeof(int)*8+1];
unsigned int c;
int i = 0;
char *begin, *end, tmp;
while (num!=0)
{
c = num%n;
hexBuf[i++] = c>9?c+'a'-10:c+'0';
num /= n;
}
hexBuf[i] = '\0';
printf("end\n");
begin = &hexBuf[0];
end = &hexBuf[i-1];
while(begin < end)
{
tmp = *begin;
*begin = *end;
*end = tmp;
begin++;
end--;
}
return hexBuf;
}
{
static char hexBuf[sizeof(int)*8+1];
unsigned int c;
int i = 0;
char *begin, *end, tmp;
while (num!=0)
{
c = num%n;
hexBuf[i++] = c>9?c+'a'-10:c+'0';
num /= n;
}
hexBuf[i] = '\0';
printf("end\n");
begin = &hexBuf[0];
end = &hexBuf[i-1];
while(begin < end)
{
tmp = *begin;
*begin = *end;
*end = tmp;
begin++;
end--;
}
return hexBuf;
}