Question: Write a function readBooks that populates a pair of arrays with the titles and authors found in books.txt. This function should: Accept five input arguments

Write a function readBooks that populates a pair of arrays with the titles and authors found in books.txt. This function should: Accept five input arguments in this order: string: the name of the file to be read string array: titles string array: authors int: the number of books currently stored in the arrays int: capacity of the authors/titles arrays [assume to be 50] Use ifstream, stringstream, and getline to read and parse data from the file, placing author names in the authors array and titles in the title array Return the total number of books in the system, as an integer. If the file cannot be opened, return -1

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!