0

I created one simple class Sea. I manually make the objects (obj1, obj2, obj3) and passed them to the vector:

vector<Sea> seaVector;
seaVector.push_back(obj1);
seaVector.push_back(obj2);
seaVector.push_back(obj3);

Now, I need to sort them by name alphabetically, I guess that this doesn't work the same as sorting a vector of values. I can't swap objects, either.

Please help me, I have 4 hours before the deadline.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • https://stackoverflow.com/questions/1380463/sorting-a-vector-of-custom-objects – WhozCraig Jun 26 '22 at 07:48
  • "*Please help me, I have 4 hours before the deadline*" - this is a Q&A site, not a real-time chat site. There is never a guarantee that you will get answers in such a short amount of time. And this is not the place for people to tell you how to do your homework or competition work. – Remy Lebeau Jun 26 '22 at 08:27
  • *4 hours before the deadline* That's nothing, when you become a professional programmer you'll find that the deadline was 3 months ago and your team still have months of work to do. – john Jun 26 '22 at 08:27

0 Answers0