title: Error: expression cannot be used as a function?
body: <p>I created a quick method in my program to compute the distance between two points using the distance formula, here's the code:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  
  using namespace std;
  
  int distanceFormula(int x1, int y1, int x2, int y2) {
      double d = sqrt((x1-x2)^2(y1-y2)^2);
      return d;
  }
  </code></pre>
  <p>it gives me a compiler error on the line where I declare the <code>d</code> variable saying that</p>
  <p><code>error: expression cannot be used as a function</code>.</p>
  <p>What does this mean? And what am I doing wrong?</p>