int main()
{
FILE * fpPhoto, *Head_w;//定义指向文件的指针
unsigned char Exif;
fopen_s(&fpPhoto,"E:\\吴老师\\wu teacher\\DJI_0001.JPG", "rb");//以只读方式打开一个二进制文件
if (!fpPhoto)
{
printf("打开文件失败!\n");
system("pause");
return -1;
}
else
{
printf("打开成功!\n");
fseek(fpPhoto, 3L, SEEK_SET);
fread(&Exif, sizeof(unsigned char), 1, fpPhoto);
printf("%x\n%d",Exif,Exif );
}
Exif = 97;
fopen_s(&Head_w, "C:\\Users\\Administrator\\Desktop\\01.txt", "w");//以只写方式打开一个文本文件,指定文件不存在,建立新文件
fwrite(&Exif, sizeof(unsigned char), 1, Head_w);
fclose(fpPhoto);
fclose(Head_w);
system("pause");
return 0;
}