Course Solutions Uncategorized (Solved) : Correct Errors Following Code Segments Following Code Write 100 Empty Clientdata Objects O Q29754179 . . . .

(Solved) : Correct Errors Following Code Segments Following Code Write 100 Empty Clientdata Objects O Q29754179 . . . .

 

Correct any errors in the following codesegments:

The following code should write 100 empty ClientData objects tothe ofstream object outCredit, which
has already been successfully opened.

ClientData blankClient; // constructor zeros out each datamember // output 100 blank records to file for ( int i = 0; i <100; i++ ) outCredit.write( ( blankClient ), sizeof( ClientData ));

The following line of code should create fstream objectoutCredit attached to file “credit.dat” for input
and output of fixed-length records.

fstream outCredit( “credit.dat”, ios::in & ios::out &ios::binary );

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post