what is the operator+=() and why we use in c++ code example
Example 1: operator overloading in c++
Box operator+(const Box&);
Example 2: x += c++
int main ()
{
int a, b=3;
a = b;
a+=2; // equivalent to a=a+2
cout << a;
}
Box operator+(const Box&);
int main ()
{
int a, b=3;
a = b;
a+=2; // equivalent to a=a+2
cout << a;
}