Question: 2017 Winter CIS200 Lab 10 Release date: April 6, 2017 Due date: April 20, 2017 Given: struct clientData int accountNumber, char lastName[ 15]; char firstNamel

 2017 Winter CIS200 Lab 10 Release date: April 6, 2017 Duedate: April 20, 2017 Given: struct clientData int accountNumber, char lastName[ 15];char firstNamel 10 float balance; Create a random access file of 100

2017 Winter CIS200 Lab 10 Release date: April 6, 2017 Due date: April 20, 2017 Given: struct clientData int accountNumber, char lastName[ 15]; char firstNamel 10 float balance; Create a random access file of 100 records named "credit.dat" using these code segments: ofstream outCredit( "credit dat", ios: out clientData blank Client 10, 0.0 for (int i 0; i 100, i++) out Credit, write (reinterpret castsconst char &blankclient), sizeof( clientData) Kostream member function write The Kostream member function write outputs a fixed number of bytes beginning at a specific location in memory to the specific stream. When the stream is associated with a file, the data is written beginning at the location in the file specified by the "put" file pointer. The write function expects a first argument of type const char hence us the reinterpret cast const char to convert the address of the blankClient to a const char The second argument of write is an integer of type size t specifying the number of bytes to written. Thus the use of sizeof( clientData)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!