class solution
{
pulbic:
bool cmp(int,int){};
void myf(vector<int>&nums)
{
sort(nums.begin(),nums.end(),cmp);//此处的leetcode等编译器提示invalid use of non-static member function,VS提示:应输入2个参数,却提供了3个
}
}
首先从原理上分析这个错误的原因:
class solution
{
pulbic:
bool cmp(int,int){};
void myf(vector<int>&nums)
{
sort(nums.begin(),nums.end(),cmp);//此处的leetcode等编译器提示invalid use of non-static member function,VS提示:应输入2个参数,却提供了3个
}
}
首先从原理上分析这个错误的原因: