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

![date: April 20, 2017 Given: struct clientData int accountNumber, char lastName[ 15];](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f32b49e3f95_36166f32b4938e3e.jpg)

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
Get step-by-step solutions from verified subject matter experts
