This lab concerns the linked lists and dynamic memory allocation.
~cs253/Labs/LinkedListto a convenient place in your home directory.
Makefileso that you won't have to type
this->, which are always suspicious. Remove them. Does everything still work?
.initialize()often indicate that the author of the code doesn't understand constructors. Turn them into ctors.
.remove()uses a pointer argument to return a value. How crass—use a reference, instead.
.print()that displays the list. Add another case in
main()that uses it.
For extra fame & glory:
LinkedListobject is destroyed? Fix that.
.print()is tacky. Overload the
<<operator so you can use
LinkedListobject, just like any other type.