// Ex9_03.cpp
// Calling a base constructor from a derived class constructor
#include <iostream> // For stream I/O
#include "CandyBox.h" // For CBox and CCandyBox
using std::cout;
using std::endl;
int main()
{
CBox myBox(4.0, 3.0, 2.0);
CCandyBox myCandyBox; //调用构造函数1
CCandyBox myMintBox(1.0, 2.0, 3.0, "Wafer Thin Mints"); //调用构造函数2
// CCandyBox myMintBox( "Wafer Thin Mints"); 调用构造函数1
cout << endl
<< "myBox occupies " << sizeof myBox // 输出对象占用的内存
<< " bytes" << endl
<< "myCandyBox occupies " << sizeof myCandyBox
<< " bytes" << endl
<< "myMintBox occupies " << sizeof myMintBox
<< " bytes";
cout << endl
<< "myMintBox volume is " // 得到CCandyBox对象的体积
<< myMintBox.Volume();
cout << endl;
return 0;
}