title: Implicit conversion and calling a function
body: <p>What is the use of implicit conversion in C++ when I call a function that takes parameters as int, while I pass an argument that is double? Why is this not a compile time error? What goes on in the run-time stack that allows this to happen?</p>
  
  <pre><code>#include &lt;iostream&gt;
  void foo(int num);
  
  int main() {
      double doub= 4.9;
      foo(doub);
      return 0;
  }
  
  void foo(int num){
      std::cout&lt;&lt;num&lt;&lt;std::endl;
  }
  </code></pre>