16进制数字转换为字符


//将1个16进制数字转换为字符
//hex:16进制数字,0~15;
//返回值:字符
u8 hex2chr(u8 hex)
{
	if(hex<=9)
		return (hex+'0');
	if(hex>=10&&hex<=15)
		return (hex-10+'A'); 
	return '0';
}





原文地址:https://www.cnblogs.com/alan666/p/8311929.html