FILE *fp = fopen("D:\img\logo.bmp", "rb");
fseek(fp,0,SEEK_END);
int len = ftell(fp);
fseek(fp, 0, SEEK_SET);
char *buff = (char *)malloc(len);
//char buff[4000] = {0};
memset(buff, '0' , len);
fread(buff,len,1,fp);
printf("%d\n",len);
printf("unsigned short logo[]={\n}");
for (int i = 0; i < len / 2; i++)
printf("0x%02x\n",buff[i]);
这个是源码,我将一张bmp读出来后,输出到控制台,结果发现有一部分显示的是乱码![图片说明](https://img-ask.csdn.net/upload/201805/31/1527723841_456667.png)
各位大佬,能否给小弟指点一下迷津