Looks like your program got cut off, but I think the general gist is this. Programs like this are sequential. One thing happens at a time. You are either beeping, calculating, waiting for input, display, calculating, whatever. Two things can't happen at the same time in most programs.
If you want to be able to beep and accept input at the same time, you need a separate process and/or separate threads. That can get complex. I am not too familiar with the "system" command. It's generally frowned on, but it may be a blunt instrument that can do the job in your case. I don't know.
But the right way would be to have a process/thread (there are pros and cons to each) that is spawned when the alarm goes off and which is run separately. When snooze is hit, you kill that beep process. Looks like you're in Windows. I know nothing about how to create threads/processes in Windows C++, and to be fair, not much more on ho to do it in Linux.
But I think that what you are trying to do cannot be done in one process containing one thread.
Reputation Points: 2614
Solved Threads: 687
Posting Expert
Offline 5,365 posts
since Jan 2008