【询问】一个小程序中的一个有关问题 多谢
【询问】一个小程序中的一个问题 谢谢
#include <iostream>
using namespace std;
int main ()
{
class Student
{
public :
void display ()
{
cout << "num : " << num << endl;
cout << "name : " << name << endl;
cout << "sex : " << sex << endl;
}
private :
int num;
string name;
char sex;
};
Student stud1, stud2;
return 0;
}
加上头文件#include <cstring> 也是一样的错误提示
------解决方案--------------------
#include <iostream>
using namespace std;
int main ()
{
class Student
{
public :
void display ()
{
cout << "num : " << num << endl;
cout << "name : " << name << endl;
cout << "sex : " << sex << endl;
}
private :
int num;
string name;
char sex;
};
Student stud1, stud2;
return 0;
}
加上头文件#include <cstring> 也是一样的错误提示
------解决方案--------------------