用itoa函数(需要stdlib.h头文件),假如要把a存进字符数组str[]中,则这样操作itoa(a, str, 16)。第三个参数是进制数。如果你要用代码实现,那我就写个函数给你吧:include <stdio.h> const char HexNum[] = "0123456789ABCDEF";void subDecToHex(int dec, char *&str){if(!dec) return...