Issues and suggestions about Project 1
1. Write just the code for main to create the master linked list and then print it out. If you write the entire project and you have issues with getting this part correct, then you will need to rewrite a major part of your project. BUILD INCREMENTALLY.
2. When accessing a member of a class or struct pointed to
by an iterator, you may try something like *myIterator.someMethod() or
*myIterator.someData . Here is the issue: there are 2 operations in each
of those examples, the dereference operation (*) and the dot (.) operation to
access the member. These are both operators. Operators have
precedence, so the question is which operation has precedence, dot (.) or
dereference (*). As it turns out, dot (.) has precedence over dereference
(*). So the order of evaluation will be as if you expressed the statement
as
*(myIterator.someMethod())
But this is typically not the order you want to use. You want to get the
item the iterator is pointing to first, then access the method or data within
the item. So to override the precedence, you will need to do something
like:
(*myIterator).someMethod() or (*myIterator).someData