char *tohex(unsigned int x)
{
char digits[16] = "0123456789abcdef";
static char result[10];
int i;
i = 10;
do {
--i;
result[i] = digits[x & 0xf];
x >>= 4;
} while (x != 0 && i > 0);
result[--i] = 'x';
result[--i] = '0';
return &result[i];
}
阅读(1050) | 评论(0) | 转发(0) |