1.定义时钟类,私有数据成员时、分、秒,公有函数 成员 settime(int a,int b,intc)设置时间,公有函数成员 showtime()显示时间,定义构造函数和拷贝构造函数和析构函数,在主函数中定义两个对象测试。
时间: 2023-04-02 12:02:11 浏览: 84
好的,这是一个关于定义时钟类的问题。时钟类包含私有数据成员时、分、秒,公有函数成员settime(int a, int b, int c)用于设置时间,公有函数成员showtime()用于显示时间。同时,还需要定义构造函数、拷贝构造函数和析构函数。在主函数中,可以定义两个对象进行测试。
相关问题
1.定义时钟类,私有数据成员时、分、秒,公有函数 成员settime(int a,int b,int c)设置时间,公有函数成员showtime()显示时间,定义构造函数和拷贝构造函数和析构函数,在主函数中定义两个对象测试。
好的,这是一个关于定义时钟类的问题。时钟类有私有数据成员时、分、秒,公有函数成员settime(int a,int b,int c)用于设置时间,公有函数成员showtime()用于显示时间。同时,还需要定义构造函数、拷贝构造函数和析构函数。在主函数中,可以定义两个对象来测试这个类的功能。
阅读全文
相关推荐
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![text/x-c](https://img-home.csdnimg.cn/images/20250102104920.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)