Defining getLast()
The stub of getLast() should look like this:
Item List::getLast() const {
}
The steps it should take are:
- If I am empty (e.g., mySize is zero):
-
throw an underflow_error exception
(with an appropriate error message).
- Return the value of myItem in the Node whose address is in myLast.