under this program is how to create the program using c + + software.
may be useful for you all ....
#include <stdio.h>
#include <time.h>
int main(void){
int i, j, s;
char t[9];
time_t ttrs;
struct tm *ti;
for (;;){
time(&ttrs);
ti=localtime(&ttrs);
if (s != ti->tm_sec){
printf("Sending time data : %s", t);
sprintf(t, "%d:%d:%d\n", ti->tm_hour, ti->tm_min, ti-tm_sec);
s = ti->tm_sec;
for (j = 0; j < 10; j++)
write(fd,&t[j],1);
}
s = ti->tm_sec;
}
return 0;
}
Tidak ada komentar:
Posting Komentar