simple alarm clock

I just finished my begginers cpp online class. The final kicked my booty. I tried to make a simple alarm clock that the user could enter a time to have the alarm go off and show the current time with incrementation. Any one wanna point me to some reading material with a clear example of what I am talking about? How can you interact with the sys clock or even run comparisons on it?
like hh and mm are variables why not (hh == system hours && mm == system minutes) this certain event can happen... and here is the fresh time!!!
oh well. Thanks in advance.
closed account (iwpfSL3A)
With regards to time manipulation problem - Use string object, convert the string into characters, tokenize the converted string and convert the tokenize data into numeric. In that way, you can now manipulate the time. Give it a try!
Last edited on
Here is a good reference for you:
http://cplusplus.com/reference/clibrary/ctime/

Use a time_t object to store an initial time at the start.
http://cplusplus.com/reference/clibrary/ctime/time_t/
http://cplusplus.com/reference/clibrary/ctime/time/

Then make a while loop which gets the current time and exits when the current time-initial Time > desired value
http://cplusplus.com/reference/clibrary/ctime/difftime/

Use asctime() to display the time in a nice manner on the console.
http://cplusplus.com/reference/clibrary/ctime/asctime/
Last edited on
Thank you so much for the feed back. I am gonna give it a try this afternoon!!! I managed an 80% in the class woot!
ok... I see that the answer is somewhere in there. So I will start this as a personal project.

Topic archived. No new replies allowed.