为什么调试不出
#include<iostream>#include<string>
using namespace std;
class student
{
public:
student(int a,string b,char c)
{
num=a;
name=b;
sex=c;
}
void display();
private:
int num;
string name;
char sex;
};
void student::display()
{
cout<<"num:"<<num<<"name:"<<name<<"sex:"<<sex<<endl;
}
class student1:public student
{
public:
student1(int a,string b,char c,int a1,string b1,char c1,int d,string e):student(a, b, c),aaa(a1,b1,c1)
{
age=d;
addr=e;
}
void display1()
{
display();
cout<<"age:"<<age<<endl<<"addr:"<<addr<<endl;
}
void aaa_display()
{
aaa.display();
protected:
student aaa;
int age;
string addr;
};
int main()
{
student1 stud(1001,"wanglin",'f',1002,"lili",'d',19,"sadasdsa");
stud.display1();
stud.aaa_display();
return 0;
}