J
John
I have a class
class Point2D {
double x[2];
public:
.....
}
I want to implement a function that can take in as input
point2Dsort( double * pdA, int number_of_points)
and sort it in lexicographic order. (i.e. if p1.x() > p2.x() then p1 >
p2 ...
Is there a way to define operator< on the point class and implement
point2Dsort using c++ sort() function?
Thanks,
--j
class Point2D {
double x[2];
public:
.....
}
I want to implement a function that can take in as input
point2Dsort( double * pdA, int number_of_points)
and sort it in lexicographic order. (i.e. if p1.x() > p2.x() then p1 >
p2 ...
Is there a way to define operator< on the point class and implement
point2Dsort using c++ sort() function?
Thanks,
--j