Write here if you have problems with your C++ source code
Moderator: Board moderators
- New poster
- Posts: 3
- Joined: Sat Jan 19, 2008 5:28 am
Is this the correct way to use sort?
Code: Select all
//include files (iostream, algorithm, vector, etc.)
bool operator < (const C& r) const
if (some_attribute < r.some_attribute)
I ask this becuase many times I will implement a program using sort() and get a WA, but when I use a sorting method of my own (bubble sort), the program gets accepted.
- Learning poster
- Posts: 51
- Joined: Tue Sep 04, 2007 2:12 pm
- Location: Russia, Saratov
I use standard sort() always, and I never had any problems.