well it's a plus symbol, and overloading is used for classes... so you need to add the two objects together so to speak. The point is it's up to you how or what methods/variables you want to add together. See the tutorial on this site for more info.
# include <iostream>
usingnamespace std;
class A{
private :
int x;
int y;
public:
A operator+(A p) const;
A ()
{
x=1;
y=1;
};
int getx()
{
return x;
}
A(int n): x(n){};
A(int n,int m): x(n),y(m){};
};
A A::operator+(A p) const {
return A(x+p.x);}
int main()
{
A a(10, 20);
A b;
A c =a+b+3;
cout<<c.getx()<<" ";
return 0;
}