首页下载资源后端汉字与十六进制互转,输入1汉字转十六进制,输入2十六进制转汉字

ZIP汉字与十六进制互转,输入1汉字转十六进制,输入2十六进制转汉字

weixin_5356914447.48KB需要积分:1

资源文件列表:

汉字与十六进制互转.zip 大约有10个文件
  1. main.c 1.08KB
  2. main.o 1.65KB
  3. Makefile.win 1.16KB
  4. 转换.dev 939B
  5. 转换.exe 132.13KB
  6. 转换.ico 2.19KB
  7. 转换.layout 93B
  8. 转换_private.h 583B
  9. 转换_private.rc 91B
  10. 转换_private.res 2.45KB

资源介绍:

工程可在dev软件中打开,压缩包中带有exe文件,可在window下直接执行
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ #define MAX_NUM 100 int main() { unsigned char hanzi[MAX_NUM] = {0}; unsigned char hex[MAX_NUM] = {0};//0xB0,0xAE,0xCE,0xD2,0xD6,0xD0,0xBB,0xAA int i = 0; int flag; do { printf("汉字转十六进制输入1\n十六进制转汉字输入2\n请输入:"); scanf("%d",&flag); if(flag == 1) { printf("请输入汉字:"); scanf("%s",&hanzi); printf("输入汉字的十六进制为:"); for (i = 0; i < MAX_NUM; i++) { if(hanzi[i] == '\0') { break; } printf("%02X ",hanzi[i]); } printf("\n"); } else if(flag == 2) { printf("请输入十六进制的数:"); while (getchar() != '\n') { ; } i = 0; do{ scanf("%x",&hex[i]); i++; if(i >= MAX_NUM) { break; } }while(getchar()!='\n');//遇到换行时结束循环 printf("输入十六进制的汉字为:"); printf("%s\n",hex); } else { printf("输入错误,请重新输入1或2!!!\n"); } }while(1); return 0; }
100+评论
captcha