Home » Ask & Discuss » Board Exams - CBSE, ICSE, State Boards » Computer Science « Back to Discussion
Computer Science
file handling!!!!!!!!rates assured!!!!!
None
in certain Q they ask the missing statement:
eg;consider a class book having a func modify()
void modify(book new)
{fstream file;
file .open("book.dat",ios::in|ios::out);
book ob;
int rr=0,f=0;
while(!file)
{file.read(char* &ob,sizeof (ob));
rr++;
if(new.bno()==ob.bno())
{
_______________________
file.write(char* &new,sizeof (new));
f=1}
:
:
:
}
can d missing statement be: file.seekp(sizeof(ob));
or file.seekp(file.tellg());
plz reply soon
rates assured
!!!!!!!!!!!!!!!!!!!!












and file.seekp(file.tellg()) will keep u at d place where u are