填写下面的代码 void dec2hex(int c) { char hex[64] = {0}; printf("int %d, hex %s/n", c, hex); } 将int值按照16进制输出,可以使用'%x'转换 void dec2hex(int c) { char hex[64] = {0}; if(MSB & c) /* negative, */ sprintf(hex, "-%X", -c); else sprintf(hex, "%X", c); printf("int %d, hex %s/n", c, hex); }