Hello there, I have to overload the subscript operator to return the largest element of a collection, the second largest, the third largest, and so on.
I don't really understand what to do. Do I have to create an array and sort it? What the output will looks like? I'm confused.Nicole
nicoletonyf
0
Newbie Poster
Recommended Answers
Jump to PostI fixed a couple of problems I noticed after I submitted the posting....
// C is the collection type and I is the item type.
template<class I, class C<I>>
I& operator[](C<I>& someCollection, long index)
{
// must build an index (sorted list) of the items in the collection
// …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.