摘要: 基类与派生类的构造函数一、缺省构造函数的调用关系通过下面的例子,我们来看一下基类与派生的构造函数的调用顺序。创建时先基类后派生类。销毁时先派生类后基类。#include <iostream>#include <string>using namespace std;class CBase { string name; int age;public: CBase() { cout <<"BASE" << endl; } ~CBase() { cout <<"~BASE" << endl; 阅读全文
posted @ 2013-05-31 09:26 一笔江湖 阅读(230) 评论(0) 推荐(0) 编辑