bool operator<(Human& man)// 需要修改为 bool operator<(const Human& man) const
{
return Human.age < man.age;
}
#include<stdio.h>
#include<string>
int main()
{
const char *p = "abc";
int i = strlen(p);//这行代码编译不过,//需要添加头文件 string.h
return 0;
}
bool operator<(Human& man)// 需要修改为 bool operator<(const Human& man) const
{
return Human.age < man.age;
}
#include<stdio.h>
#include<string>
int main()
{
const char *p = "abc";
int i = strlen(p);//这行代码编译不过,//需要添加头文件 string.h
return 0;
}