函数模板问题,我想实现无论输入哪种数据都能比较大小,编译不能通过,请问错哪了
#include <iostream>#include<string>
using namespace std;
template<class x>
int main()
{
x a;
x b;
void get()
{
cout<<"input the datas:"<<endl;
cin>>a>>b;
}
x max (x a, x b)
{
return a>b?a:b;
}
cout<<max()<<endl;
return 0;
}
错误提示如下: error LNK2001: unresolved external symbol _main
Debug/未完.exe : fatal error LNK1120: 1 unresolved externals