#include <iostream>
class Example {
public:
int a;
int b;
Example() {}
Example(int a, int b) {
this->a = a;
this->b = b;
}
Example operator+(Example obj) {
Example result;
result.a = this->a + obj.a;
result.b = this->b + obj.b;
return result;
}
};
int main() {
Example obj1(7, 9);
Example obj2(2, 4);
Example sum;
sum = obj1 + obj2;
std::cout << sum.a << " " << sum.b;
}
/*
run:
9 13
*/