C++基于sort排序对象

有时咱们须要对某个数据进行排序,例如基于id升序或降序排列坐标点。使用sort排序vector中的对象。 结构体定义以下:web struct Point2f { double x; double y; int id; } static bool cmp(const Point2f &A, const Point2f &B){ return A.id > B.id;
相关文章
相关标签/搜索