So I have a clock problem to. I want to update the clock in real time so that I can see the seconds tick by!
Here's what I am using:
char *aORp;
int tm_year;
struct tm *systime;
time_t t;
t=time(NULL);
systime=localtime(&t);
if(systime->tm_hour>12) {systime->tm_hour=
systime->tm_hour-12; aORp = "p.m."; }
else{aORp = "a.m.";}
I would hate to call "t=time(NULL);" every other line of code!(And I'm sure it's not done this way).
But I just don't know how to write a function that runs constantly yet releases the rest of the program to resume normally!