title: Operator += class overloading : parameter error
body: <pre><code>CPP-file:
  
  Matrix2x2&amp; operator +=(const Matrix2x2 &amp; rhs)
  {
      for (int i = 0; i &lt; 2; i++)
      {
          for (int n = 0; n &lt; 2; n++)
          {
              this-&gt;anArray.[i][n] += rhs.anArray[i][n];
          }
      }
      return *this;
  }
  </code></pre>
  
  <p>Header-file:</p>
  
  <pre><code>class Matrix2x2
  {
  private:
      double anArray[2][2];
  public:
      Matrix2x2();
      Matrix2x2(int a, int b, int c, int d);
      void setArrayValues(int row, int column, double value);
      const double getArrayValues(int row, int column) const;
      Matrix2x2&amp; operator +=(const Matrix2x2 &amp; rhs)
  };
  </code></pre>
  
  <p>Main file:</p>
  
  <pre><code>Matrix2x2 aMatrix(4,4,4,4);
  Matrix2x2 bMatrix;
  aMatrix += bMatrix;
  </code></pre>
  
  <p>When I try to run this, I get this:</p>
  
  <p>error: 'Matrix2x2&amp; operator+=(const Matrix2x2&amp;)' must take exactly two arguments</p>
  
  <p>I can't see why?</p>
  
  <p>I replaced it with </p>
  
  <pre><code>Matrix2x2&amp; Matrix2x2::operator+=(const Matrix2x2 &amp; rhs);
  </code></pre>
  
  <p>and then I got these errors:</p>
  
  <pre><code>error: extra qualification 'Matrix2x2::' on member 'operator+='
  </code></pre>
  
  <p>in the header file and</p>
  
  <pre><code>error: expected unqualified-id before '[' token|
  </code></pre>
  
  <p>in this line:</p>
  
  <pre><code> this-&gt;anArray.[i][n] += rhs.anArray[i][n];
  </code></pre>
  
  <p>UPDATE2</p>
  
  <p>I've shown you my class declaration in the header file, the invocation in the main file and the function definition in my cpp file. What else is there to show? I've currently corrected all that you pointed out, but I still get one of the same errors:</p>
  
  <pre><code>error: extra qualification 'Matrix2x2::' on member 'operator+=
  </code></pre>
  
  <p>in the cpp and header file.</p>