申論題內容
⑵請解釋每一行輸出是由那個物件在那個時間點前後(請參考程式所標示的時間點
1, 2 ,3 ,4 ,5)印出的?
#include "car.h"
#include
using namespace std ;
Car::Car() { cout << "Car is constructed" << endl ;}
Car::~Car() { cout << "Car is destroyed!" << endl ;}
//----------------------------------------------------
Car honda ;
1:main() {
2: Car bmw ;
3: Car *camery = new Car() ;
4: honda.color = 1 ;
5: camery.color = 100 ;
6:}