Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the effect of Electronic clock in C++

Shulou Source: shulou.com Published: 2022-05-31 17:13:19 11月14日 Update

Today Xiaobian to share with you how C++ to achieve electronic clock effect related knowledge points, detailed content, clear logic, I believe most people still know too much about this knowledge, so share this article for everyone to refer to, I hope you read this article after some harvest, let's learn about it together.

This is accurate to the second, because there is accuracy error and it is relatively simple to obtain the initial time from the computer, so there will be a large error in running for a period of time.

code

#include#include#includeusing namespace std;class Clock{private: int hour, minute, second; int year, month, day,week;public: Clock() {}; void SetTime1(int _Hour, int _Mins, int _Sec){//initial time function hour = _Hour; minute = _Mins; second = _Sec; } void SetTime2(int _year, int _month, int _day,int _week) {//initial time function year = _year; month = _month; day = _day; week = _week; } void ShowTime() { cout

Tags: Time knowledge articles effects clocks electronics clocking content functions dates errors differences large accurate large code information variables most objects Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft Shulou Technology Redmi MariaDB