0
What is Sort (built-in function) with three parameters Do ?
for example : Sort (vec.begin() , vec.end() , cmp);
4 ответов
+ 2
cmp is a function used by Sort to determine if an argument is less than another. You write this function.
+ 2
For examples you can write a class Bank to rappresent an bank account...if you have N objects and you want sort them, you can decide how to do it. You want order them according money? Or according creation date?
You have to write a function that accepts two Bank objects and return a bool value. And in this function you choose what make an object smaller than another.
+ 1
You're welcome.
0
0K .. thank u