What is the error in my code ?
IntelliSense: more than one instance of overloaded function "max" matches the argument list:
error C2668: 'max' : ambiguous call to overloaded function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include<iostream>
usingnamespace std ;
template <class T >
T max ( T a , T b )
{
if ( a>b)
return a ;
return b;
}
void main ()
{
cout << max(10 , 20) ;
}