Hello all, I have a sorting function from lowest to highest, highest to lowest, and sort by the type then highest to lowest for each of its type.
ShapeTwoD is my object now, which is also a parent class.
I have 3 sub classes for polymorphism which i store the sub class objects into the vector.
Below are the codes to sort by area. In the object itself, there are also shape types being stored as well, which are "WS" and "NS". I want to sort it base on "WS" first, followed by "NS". After which, it will then sort highest to lowest in "WS", followed by highest to lowest in "NS".
I need some advice and ideas on how to do this sort. Thanks in advance
Hi there- you can create a custom sort object with an overloaded operator that will allow you to sort by any parameters you would like. You just provide a comparison function.