title: no matching function for call to ' '
body: <p>I was given to implement the function:</p>
  
  <pre><code> "static double distanta (const Complex&amp;, const Complex&amp;);"
  </code></pre>
  
  <p>which return the distance between two Complex numbers. The definition of the function it is inside the Complex class and I have implemented it like that: </p>
  
  <pre><code>double Complex::distanta(const Complex &amp;a, const Complex &amp;b)
  {    
      double x = a.real() - b.real();
      double y = a.imag() - b.imag();
  
      return sqrt(x * x + y * y);
  }
  </code></pre>
  
  <p>As far as I know a static function can only access static members and my class only has</p>
  
  <pre><code>double _re;
  double _im;
  </code></pre>
  
  <p>as data members.</p>
  
  <p>Within the main function I have called it as:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "complex.h"
  
  using namespace std;
  
  int main()
  {
      Complex* firstComplexNumber; 
      firstComplexNumber = new Complex(81, 93);
  
      cout &lt;&lt; "Numarul complex este: " &lt;&lt; *firstComplexNumber &lt;&lt; endl;
  
      Complex* secondComplexNumber;
      secondComplexNumber = new Complex(31, 19);
  
      cout &lt;&lt; "Distanta dintre cele doua numere" &lt;&lt;endl &lt;&lt; endl;
      Complex::distanta(firstComplexNumber, secondComplexNumber);
      return 0;
  }
  </code></pre>
  
  <p>and the error I get is:</p>
  
  <p>error: no matching function for call to 'Complex::distanta(Complex*&amp;, Complex*&amp;)'</p>
  
  <p>Could you please tell me what is it that I'm doing wrong? 
  Thanks!</p>