struct point { int x, y; }; /* point point_add(point a, point b) { point c = {a.x + b.x, a.y + b.y}; return c; } */ point operator +(point a, point b) { point c = {a.x + b.x, a.y + b.y}; return c; } #include int main() { point a = {1, 2}; point b = {3, 4}; point c = a + b; std::cout << c.x << ", " << c.y << std::endl; }