Hi so I have a homework assignment and have it all done except for the last requirement. We're pulling in data from a txt file and several of the box office values are 0. Instead of returning the first instance of 0, we are to return the last instance of 0. Here's a snippet of code:
long long worldBoxOffice = movie.getWorldBoxOffice();
movieMap.insert(pair<long long, Movie>(worldBoxOffice, movie));
So after inserting the pair into the map, what is it that I should be doing? Would it be overloading the [] operator? Kinda confused so any help is appreciated. I didn't post more code because I'm not looking for code, just a push in the right direction as to how to go about it. Thanks.
Note: we have to use maps, not allowed to use multi maps, etc.