title: const Function Overloading
body: <p>I am confused why the following code is not producing any error ,because the arguments passed to display are of same type i.e <code>char</code>.Does <code>const</code> really makes difference?</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  void display(char *p)
  {
      cout&lt;&lt;p;
  }
  void display(const char *p)
  {
      cout&lt;&lt;p;
  }
  
  int main()
  {
      display("Hello");
      display("World");
  }
  </code></pre>
  
  <p><strong>EDIT</strong>
  As per answers,the first display is never called,which is correct and so is the output.</p>
  
  <p>But suppose I do it like :</p>
  
  <pre><code>int main()
  {
      char *p="Hello";
      display(p);//now first display is called.
      display("World");
  }
  </code></pre>
  
  <p>Compiler gives a <code>warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]</code> but then it calls first display.Does it mean that string is now no more taken as constant?</p>