Why does this code call different template function in vs2005?
<p>The code is:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

// compares two objects
template &lt;typename T&gt; void compare(const T&amp;, const T&amp;){
    cout&lt;&lt;"T"&lt;&lt;endl;
};
// compares elements in two sequences
template &lt;class U, class V&gt; void compare(U, U, V){
    cout&lt;&lt;"UV"&lt;&lt;endl;
};
// plain functions to handle C-style character strings
void compare(const char*, const char*){
    cout&lt;&lt;"ordinary"&lt;&lt;endl;
};

int main() {

    cout&lt;&lt;"-------------------------char* --------------------------"&lt;&lt; endl;

    char* c="a";
    char* d="b";
    compare(c,d);

cout&lt;&lt;"------------------------- char [2]---------------------------"&lt;&lt; endl;

    char e[]= "a";
    char f[]="b";
    compare(e,f);

    system("pause");
}
</code></pre>

<p>The result is:</p>

<blockquote>
  <p>-------------------------char* --------------------------</p>
  
  <p>T</p>
  
  <p>------------------------- char [2]-----------------------</p>
  
  <p>ordinary</p>
</blockquote>

<p>And my question is:
Why does compare(c,d) call compare(const T&amp;, const T&amp;) and compare(e,f) call the ordinary function even though the arguments of the two functions are char*s?</p>
