用这几个函数fopen,fread,fwrite,fseek。FILE *fp;char *file1="文件名";unsigned char s[2];
unsigned char tem[2];fp = fopen(file1,"rb");//读写方式打开二进制文件
//fseek(fp,0, SEEK_CUR);
fread(s,2,1,fp);//读取2个字节
fclose(fp);
tem[0]=s[1];//交换
tem[1]=s[0];
fp = fopen(file1,"rb+");
fseek(fp,0, SEEK_CUR);//当前位置第一个字节
fwrite(tem,2,1,fp);
fclose(fp);
bin:二进制文件