View the step-by-step solution to:

Implement the function maxLoc(), which returns an iterator pointing at the largest element in a list. //return an iterator pointing to the largest...

Implement the function maxLoc(), which returns an iterator pointing at the largest element in a list.
//return an iterator pointing to the largest element
//in the list.
template list::iterator maxLoc(list& aList);
Write a program taht tests maxLoc(), using the following declarations:
string strArr[] = ("insert", "erase", "template", "list");
int strSize = sizeof(strArr)/sizeof(string);
list strList(strArr, strArr+StrSize)
The program should repeatedly call maxLoc(), output the largest value, and then delete the value, until the list is empty.
I am attaching a .cpp file of the program. It is mostly complete but when I compile I don't seem to get the right result.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question