You also need a function for adding an element to a list. In the simple
implementation described here, all additions are made to the front of the
list using the add
member function. When you use add
, you
instantiate the following pattern:
A header variable | | Name of the element-adding function | | v v train.add (pointer to a railroad_car object);