Hi, I want to rewrite the contents (object) in a specific file, I set the position, but 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; }
source share