Created
March 30, 2011 03:33
-
-
Save scheibo/893818 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int qsort_cmp ( const void * elem1, const void * elem2 ) { | |
| int y_diff = (*(Point **)elem1)->y() - (*(Point **)elem2)->y(); | |
| return (y_diff != 0 ? y_diff : (*(Point **)elem1)->x() - (*(Point **)elem2)->x() ); | |
| } | |
| vector< Point* > points(n,NULL); | |
| qsort(&points[0] , n, sizeof(Point*), qsort_cmp ); | |
| 11 minutes ago · Like · |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment