#include
#include
using namespace std;
class Student
{
public:
Student(int n,string nam,char s)
{
num = n;
name = nam;
sex = s;
cout<<"Constructor called."<
~Student()
{
cout<<"Destructor called."<
void display()
{
cout<<"num: "<
private:
int num;
char name[10];
char sex;
};
//主函数
#include
#include
#include"xi.h"
using namespace std;
int main()
{
Student stud1(10010,"Wang_li",'f');
stud1.display();
Student stud2(10011,"Zhang_feng",'m');
stud2.display();
return 0;
}
这个程序不能通过,不知道是什么缘故,求大神指点,是这样显示错误的:
e:\code\xigou\xi.h(10) : error C2440: '=' : cannot convert from 'class std::basic_string