//----------------------------------------------------------------- // Author: Zhixiang Chen // Class: CSCI/CMPE 2380, Spring 2009 // Lab 5: Inheritance - understanding member status, // the chain reaction of constructor calling, // and the chain reaction of destructor calling // Date: January 14, 2009 // Comment: The code here is meant to be revised. // //----------------------------------------------------------------- // // This lab exercise is practice class inheritance and to understand // member status under inheritance // // Compile and run your program. When everything is fine, // print your .cpp and .h files and turn them to me or the TA. // ***************************************************************** #include < iostream > #include < fstream > #include < string > #include < cstring > #include < cmath > #include < cstdlib > #include < iomanip > #include < vector > #include "lab2380_5_head.h" using namespace std; int main() { /************************************************************************ Part A: (1) Create local blocks to see the creation and destruction of class objects. (2) You shall check the output to make sure you understand why it is so (3) Pay close attention to member status (4) Pay close attention to the chain reaction of constructor calling and the chain reaction of destructor calling ************************************************************************/ //a local block to see A's objects { A cat; //create cat cat.printA(); } //cat dies when out of this block cout<<"A dies here********"<