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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started