使用函数模板出现了一点问题
#include "iostream"
using std::cout;
using std::cin;
using std::endl;
template <class T>
T maximum( T value1, T value 2, T value3)
{
T max=value1;
if(value2>max)
max=value2;
if(value3>max)
max=value3;
return max;
}
int main()
{
int int1,int2,int3;
cout<<"input three integer values:\n";
cin>>int1>>int2>>int3;
cout<<"maximum(int1,int2,int3)";
cout<<endl;
return 0;
}
运行出现了下列错误:
E:\C++\3_27\3_27.cpp(7) : error C2143: syntax error : missing ',' before 'constant'