class Student
{
string m_strNum;
string m_strName;
public:
Student(const string &strNum, const string &strName)
{
m_strNum = strNum;
m_strName = strName;
}
};
class CollageStudent : public Student
{
string m_strMajor;
public:
CollageStudent(const string &strNum, const string &strName, const string &strMajor)
: Student::Student(strNum, strName),
m_strMajor(strMajor)
{
cout << "construct collage student\n";
}
};
int main()
{
CollageStudent cs("1234", "Jack", "Software Engineering");
system("pause");
return 0;
}
什么时候要,急用吗?