The stub of append() should look like this:
void List::append(const Item& it) {
}
The steps append() should take are:
- Allocate a new Node in which myItem is it and myNext is NULL;
save its address in nodePtr.
- If I am empty:
- Make myFirst point at the new node (using nodePtr).
Otherwise:
- Make myLast->myNext point at the new node (using nodePtr).
- Make myLast point at the new node (using nodePtr).
- Increment mySize.