//seek.cpp //Output and Input from the same file, seekp demo #include "stdafx.h" #include #include #include #include using namespace std; void main(void) { FILE* fp=fopen("C:\\temp\\tt.bin","w+b"); //read+write and binary if(fp==NULL){cout<<"File Error!\n"; getch(); return;} for(char i=1 ; i<11 ; i++) fwrite(&i,sizeof(char),1,fp); //write to file 1-10 fseek(fp,5,0); //read, increment, and write back the sixth byte char tmp; fread(&tmp,sizeof(char),1,fp); tmp++; fseek(fp,5,0); fwrite(&tmp,sizeof(char),1,fp); fseek(fp,0,0); //print file cout<