+1 vote
in Class 12 by kratos

Answer the questions (i) & (ii) in the program segment given below for the required task

(i) Write Statement 1 to position the file pointer to the appropriate place so that the data updation is done for the correct Route.

(ii) Write Statement 2 to perform the write operation so that the updation is done in the binary file “ROUTE.DAT”.

1 Answer

+5 votes
by kratos
 
Best answer

(i) File.seekg(-sizeof(R), ios::cur);

(ii) File.write((char*)&R,sizeof(R));

...