title: got confused with overriding in C++
body: <p>so I faced this question in an interview and got very confused about the overloading rules, could you point me to the explication at compile time.</p>
  
  <p>The overloaded function:</p>
  
  <pre><code>int mult(int a, int b)
  {
      cout&lt;&lt;"int "; return a*b;
  }
  
  long mult(long a, long b)
  {
      cout&lt;&lt;"long "; return a*b;
  }
  
  float mult(float a, float b)
  {
      cout&lt;&lt;"float "; return a*b;
  }
  </code></pre>
  
  <p>And then the calls:</p>
  
  <pre><code>long m = mult(5.2,7);
  cout&lt;&lt;"result "&lt;&lt;m&lt;&lt;endl;
  float f = mult(5,7.2);
  cout&lt;&lt;"result "&lt;&lt;f&lt;&lt;endl;
  </code></pre>
  
  <p>What are the rules for the choice between the functions?</p>