Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

=+j Enabling a productive global workforce.

Answered: 1 week ago

Question

=+ Are you interested in creating or

Answered: 1 week ago