学习笔记:编写Clock类同时学习operator重载符的使用
参考书目:C/C++规范设计简明教程——思维训练、上级实验指导,P216 目的:编写Clock类,同时学习operator重载符的使用 第一步:建立win32工程,项目名称为:TestClockClass 第二步:添加Clock类,头文件Clock.h如下: #pragma once #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; class Clock { private: int fHour, fMinute, fSecond; //私有变量,时、分、秒 p
下载地址
用户评论