What is wrong with this piece of C++ code?
<p>I have just started programming in C++ and I was playing around with templates. </p>

<p>The following code fails at run time and I have no clue why. (Please note that it is just a sample code and not used in production)</p>

<pre><code> bool maxCompare(string* s1,string* s2){
    cout&lt;&lt;*s1&lt;&lt;endl;
    cout&lt;&lt;*s2&lt;&lt;endl;    
    return true; //If I comment this line and instead use the line below, it works fine.
    //return *s1 &lt; *s2;
}

int main()
{
    string* s1=new string("Hello");
    string* s2=new string("Hi");
    string *s3= max(s1,s2,maxCompare);
}
</code></pre>
