Question: Please download the following files from CANVAS: List.h, List.cpp and Lab7Driver.cpp. In this exercise, you are asked to overload the input operator (>>) for the

Please download the following files from CANVAS: List.h, List.cpp and Lab7Driver.cpp. In this exercise, you are asked to overload the input operator (>>) for the List class. This should allow us to modify the contents of a list from user input. Let testList be a List object. Then the following expression: cin >> testList; should allow the user to input a list of integers from the keyboard, separated by space. The user input can be of arbitrary length, and the user can use any non numeric word to end the input. For example, if the user types

istream& operator>> (istream & inputStream, List & destList) { inputStream >> destList.mySize; return inputStream; }

// Is this correctly overloaded?

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!