Hi there
Is there a way to create the clock or show the system clock
and it can also tick as the seconds changes
Thank
Hi there
Is there a way to create the clock or show the system clock
and it can also tick as the seconds changes
Thank
You can do it with a windows function.
Look up
If your unfamiliar with windows I can try to help you a little further. Basically the LP before the struct name is a typedef for a pointer to it. You pass the structure and it will fill it in with the appropriate information.Code:VOID GetSystemTime( LPSYSTEMTIME lpSystemTime );
Good Luck.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
Code:#include <stdio.h> #include <string.h> #include <time.h> int main(void) { time_t now, last = time(&now), end = now + 10; while ( now < end ) { if ( last < time(&now) ) { char *text = ctime(&now), *newline = strchr(text, '\n'); *newline = '\0'; printf("\r%s", text); fflush(stdout); last = now; } } return 0; }
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*