hello, i have this following code and for some reason it keeps giving the error that it cannot convert from Point * to Point *. I've put the errors between "* *", can anyone please tell me what am i doing wrong?
Point *findMedianX(vector<Point> points, int k){
Point *pivot = (Point*) &points[points.size()-1];
vector<Point> s;
vector<Point> b;
for( int i = 0 ; i < points.size()-1 ; i++){
if( points[i].x < (*pivot).x){
s.push_back(*((Point*) &points[i]));
}
else{
b.push_back(*((Point*) &points[i]));
}
}
if( s.size() == k){
return pivot "* here it says that i cannot convert Point * to Point *";
}
if(s.size() < k){
return findMedianX(b "* here it says no suitable user defined conversion*", (k-s.size()-1));
}
else{
return findMedianX(s, k);
}
}
Please this is very important and any help would be great :D