方法/步骤 1 编写转换程序:void hex_to_str(char *hex, int hex_len, char *str){ int i, pos=0; for(i=0; i<hex_len; i++) { sprintf(str+pos, "%02x", hex[i]); pos +=2; }} 2 测试:char hex_data[] ={0x11, 0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19};ch...
void main(){ char ch1='a'; /*是字符*/ char k[5]={"sj"}; /*字符数组*/ char p[2]={ch1}; // 将单个字符转换为字符串数组,注意长度应为2 // 因为语言实现会在字符串尾部自动加上字符串结束符'0/'// 但有效字符串长度仍然为1, 即strlen(p)的结果为1 // 但使用sizeof(p)...