返回信息流先不要运行猜猜看。
大概是下面这个意思。
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <conio.h>
using namespace std;
class Vehicle
{
public:
Vehicle()
{
cout<<"constructing an Vehicle object\n";
}
class Tyre
{
public:
Tyre()
{
cout<<"constructing an Tyre object\n";
}
};
private:
Tyre type;
};
class Car:public Vehicle
{
public:
Car()
{
cout<<"constructing an Car object\n";
}
};
void main()
{
Car c; //创建对象
Vehicle d;
}
这是一条镜像帖。来源:北邮人论坛 / cpp / #15243同步于 2008/11/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
一道类的构造函数顺序上级题
lodas
2008/11/3镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。