Hi i want to overwrite the content(object) in a specific file i have set the position but it always add to the end of the file
Code
int InputIO::editPatient(int location,Obj P){
int positon=location*sizeof(P);
f.open("File.dat",ios::in|ios::out|ios::app|ios::binary|ios::ate);
f.seekp(0,ios::beg);
f.seekp(positon,ios::cur);
f.write((char*)&P,sizeof(Movie));
f.close();
return 0;
}