title: What is the syntax for Operator Overloading in C++?
body: <p>I was studying C++, and when I made a little program to learn more about <strong>Operator Overloading</strong> the program gives an erro in the main function where I wrote <em>"Ponto p1(1,5), p2(3,4), Soma;"</em>. Can anyone explain me how to use <strong>Operator Overloagin</strong> correctly? Thank you. </p>
  
  <p><em>PS: The program is in Portugueses, my native language, but I think that it will not be a problem to find my erro.</em>  </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class Ponto
  {
  private:
      int x,y;
  public:
  
      Ponto(int a, int b)
      {
         x = a;
         y = b;
      }
      Ponto operator+(Ponto p);
  };
  
  Ponto Ponto::operator+(Ponto p)
  {
      int a, b;
      a = x + p.x;
      b = y + p.y;
  
      return Ponto(a, b);
  }
  
  int main(void)
  {
      Ponto p1(1,5), p2(3,4), Soma; 
      Soma = p1.operator+(p2);
      return 0;
  }
  </code></pre>