First time here? Check out the FAQ!
answered 2018-07-29 23:43:04 -0600
your compare function is broken. also please use std::sort, not the c-style qsort.
std::sort
int compare(const Rect &a, const Rect &b) { return a.x - b.x; } std::sort(vec.begin(), vec.end(), compare);