Question: Correct any errors in the following code segments: The following code should write 100 empty ClientData objects to the ofstream object outCredit, which has already
Correct any errors in the following code segments:
The following code should write 100 empty ClientData objects to the ofstream object outCredit, which has already been successfully opened.
ClientData blankClient; // constructor zeros out each data member // 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 object outCredit attached to file "credit.dat" for input and output of fixed-length records.
fstream outCredit( "credit.dat", ios::in & ios::out & ios::binary );
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
