Home > Back-end >  (C) about memorizing words system for a great god!!!!!!
(C) about memorizing words system for a great god!!!!!!

Time:09-16

How to use C language to obtain the current computer time and put the contents of the binding together under this time in a TXT file?

CodePudding user response:

Localtime, time function check and ctime
The following for your reference ~

 # include & lt; Time. H> 

Char * asctime (const struct tm * tm);
* (const char * asctime_r struct tm tm, char * buf);

(const char * ctime time_t * timep);
(const char * ctime_r time_t * timep, char * buf);

* * struct tm gmtime (const time_t timep);
Struct tm * gmtime_r (const timep time_t * and * struct tm result);

* struct tm localtime (const time_t * timep);
* localtime_r struct tm (const timep time_t * and * struct tm result);

Time_t mktime (* struct tm tm);

CodePudding user response:

First gets the current time, the simple check C API to know, and then the time together to write the content of the TXT file

CodePudding user response:

refer to the second floor wangdong20 response:
first gets the current time, the simple check C API to know, and then the time together to write the content of the TXT file

I just don't know how to write the content of time and the TXT file duck

CodePudding user response:

You baidu about how to get the current time in C, there are words in time stored in accordance with the time to see the words, and write them TXT file
  • Related