Question
Overload the operator[] indexing operator. This is NOT a const member function, your list can change as a result of calling this function. This function
Overload the operator[] indexing operator. This is NOT a const member function, your list can change as a result of calling this function. This function takes an int value as its input parameter. This function should return an int& reference. Again it is very important that this overloaded operator return a reference. If this operator correctly returns an int&, it can actually be used as a setter to set/change the values in the list. This operator works to index your ListType like an array. You should perform bounds checking in this function. If the given input index is not valid (it is bigger than the end of your list, or it is < 0), you should display an error message and simply exit.
Written in C++
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