OK, now I have
template <typename T>
list<T>::iterator maxLoc(list<T>& aList);
{
//loop reads through the list and sets the maxLoc to equal iter if iter is greater than the current maxLoc...
Type: Posts; User: arstacey
OK, now I have
template <typename T>
list<T>::iterator maxLoc(list<T>& aList);
{
//loop reads through the list and sets the maxLoc to equal iter if iter is greater than the current maxLoc...
I'm sorry, but he did.
I see what you are saying though and what kind of problems will arise. I changed the variable to max instead.
I now have two issues. I do not have a very good understanding of tmplate based functions (we really have spent no time on them). It has also been a long time since I had to deal with reference...
Thanks, Daved. I am trying to figure that out now. I am not very good at functions so will probably post for more help later if I can't work it out.
Thanks, Daved. I really appreciate it.
1) Because that is what my instructor specifically asked for.
2) Is this wrong? I wanted maxLoc to originally equal the first element so that when iter runs through the list, it has something...
::bangs head on desk::
I have fought over this for three days. That line is actually what my instructor sent me so I never questioned that line.
It worked...sort of. I changed it to
...
I have a homework assignment I am having trouble with. The instructions are:
Implement the function maxLoc(), which return an iterator pointing at the largest element in a list.
// return an...