Could you be more specific about your requirements? I'm not certain about what you mean by a "timer" and don't want to go into long, irrelevant explanations ;-)
dear rbobbitt,
to be more specific....i want to make a doc program.. using VC 1.52..(it is a must to use this compiler.....)
the program should show the a Clock showing the current time .... it should be updated every minute....
(i.e 12:09)...how one can do it unsing this C enviroment
last=time(NULL);
for (; {
now=time(NULL);
if (difftime(now,last)>0) {
displayTime(now);
last=now;
}
}
return 0;
}
This just prints the time to stdout every second and polls the time on every iteration. If you need to display the time somewhere else (like in a status bar in a GUI program), how you do it depends on your compiler as ANSI C doesn't cover GUI interfaces.
Hopefully this will help you some. I've never used your compiler, but your compiler should give you access to the Win32 API and all of its monstrosity if you need to create GUI interfaces.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.