运行结果 Main :1a:0b:-10c:0 other 33a:4b:0c:15 -L-MAIN i:33a:0b:-10c:8 other i:75a:6b:4c:15
运行结果: ---MAIN--- i: 1 a: 0 b: -10 c: 0 ---OTHER--- i: 33 a: 4 b: 0 c: 15 ---MAIN--- i: 33 a: 0 b: -10 c: 8 ---OTHER--- i: 75 a: 6 b: 4 c: 15
例5-3具有静、动态生存期对象的时钟程序 对# lude<iostream . h 象 class clock时钟类声明 的{ public:∥外部接口 生 Clocko; 存 void SetTime(int NewH, int NewM, int NewS); ∥个形参均具有函数原型作用域 期 void ShowTime -Clocks private:∥私有数据成员 int hour minute second 体息
前一页 休息 17 例5-3具有静态、动态生存期对象的时钟程序 #include<iostream.h> class Clock //时钟类声明 {public: //外部接口 Clock(); void SetTime(int NewH, int NewM, int NewS); //三个形参均具有函数原型作用域 void ShowTime(); ~Clock(){} private: //私有数据成员 int Hour,Minute,Second; }; 对 象 的 生 存 期