妹子跟老师说她隐形眼镜丢了,由此举一反三得出结论,隐形眼镜是眼镜,隐形眼镜是由眼镜派生的,隐形眼镜是派生类(子类),眼镜是基类(父类),谢谢老师,我学到了,逻辑非常清晰,没毛病 。
2017-03-21
class ChildLabourer : public Worker,public Children
{
public:
ChildLabourer(string name, int age):Worker("Jim"),Children(20)
{
cout << "ChildLabourer" << endl;
int main(void)
{
// 使用new关键字创建童工类对象
ChildLabourer *p=new ChildLabourer("Merry",30);
结果是 Jim 20 而不是 Merry 30 不懂
{
public:
ChildLabourer(string name, int age):Worker("Jim"),Children(20)
{
cout << "ChildLabourer" << endl;
int main(void)
{
// 使用new关键字创建童工类对象
ChildLabourer *p=new ChildLabourer("Merry",30);
结果是 Jim 20 而不是 Merry 30 不懂