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
Jump to Post
I 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 RepliesReply to this topic
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.