数据转换-16进制字符
作者:互联网
1. 在utils.h和utils.c中完成16进制字符'0'-'9','A'-'F','a'-'f'与十六进制数据0-15的转换功能(10’): ``` int Hex2Char(unsigned int fromi,unsigned char * toc); int Char2Hex(unsigned char fromc,unsigned int * toi); ``` 2. 并写出测试代码测试上述函数(不能与下面代码一样),比如:(10’) ``` unsigned char * c; Hex2Char(1, &c) //结果:c = '1' Hex2Char(15, &c) //结果:c = 'F' unsigned int i; Char2Hex('1', &i); //结果:i = 1 Char2Hex('F', &i); //结果:i = 15 ```
标签:字符,15,进制,16,int,unsigned,char,Char2Hex,Hex2Char 来源: https://www.cnblogs.com/wyr20181315/p/14763010.html