@Uk Marine
I have a class and a object for the class. I can get my other functions to return the correct number but this function has to have two, ( x,y) I cant figure it out
struct Point {
double x;
double y;
Point( double x, double y ) : x(x), y(y) {}
Point & operator/= ( int s ) {
x /= s;
y /= s;
}
Point & operator+= ( Point & rhs ) {
x += rhs.x;
y += rhs.y;
return *this;
}
};
Point operator+ ( Point lhs, const Point & rhs ) {
return lhs += rhs;
}
// and much more for a compleat interface
You could of course use std::pair<double,double> or std::array<double,2>, etc, or ...
Choose an up to date and maintained third-party library that provides the required functionality (like a type for point) and has an acceptable license.