为什么输出name需要这样name.c_str()
Staff::Staff(std::string _name, int _age)
{
name = _name;
age = _age;
printf("%s,%d\n",name.c_str(),age);
}
Staff::Staff(std::string _name, int _age)
{
name = _name;
age = _age;
printf("%s,%d\n",name.c_str(),age);
}
2021-08-16
举报