title: Weird behaviour in calling template function
body: <p>I have written the following code:      </p>
  
  <pre><code>#include&lt;cstdio&gt;
  #include&lt;iostream&gt;
  #include&lt;cstring&gt;
  using namespace std;
  template &lt;class T&gt; T Min(T a, T b)
  {
      cout&lt;&lt;"template function: ";
      if(a&lt;b)
          return a;
      return b;
  }
  char *Min(char *a, char *b)
  {
      cout&lt;&lt;"non-template function: ";
      if(strcmp(a,b)==0)
          return a;
      return b;
  }
  int main()
  {
      char c[]="x",d[]="y";
  
      cout&lt;&lt;Min('x','y')&lt;&lt;endl;
      cout&lt;&lt;Min("x","y")&lt;&lt;endl;
      cout&lt;&lt;Min(c,d)&lt;&lt;endl;
  
      return 0;
  }
  </code></pre>
  
  <p>output:     </p>
  
  <pre><code>template function: x
  template function: y
  non-template function: y
  </code></pre>
  
  <p>The 1st function call is ok, it's calling the template function. But, why the 2nd function is also calling the template function while it's a string constant. Shouldn't it call the non-template function ???</p>
  
  <p>Also why the output for 2nd function calling is <code>y</code>, shouldn't it be <code>x</code> ? What's the difference between calling a function with string constant and a char type array though both are string?</p>