Assign shorcut to terminate console application

Hello!
I've been given an assignment of creating a console application which simulates the movement of shooting stars across the night sky(the console background). I've completed this part of the taks itself and it turned out pretty well.

However, an additional requirment was added a couple of days I've completed the shooting star part a new requrement was given - terminate the application at any given time by pressing the ctrl + C combination. I have no idea how to indicate that the user is pressing that key combination or have a constantly on stand-by variable which can take the user's input "behind the scenes".

Any help would be appreciated!
I don't think you need to do anything. On many systems Ctrl+C is used to close any program from the command line.
Oh God! You're right, pressing ctrl + c does stop the program. Thank you very much! I was beginning to pull my hair out, lol. I'm kinda curious as to why would my teachers add this as an additional requirement as it is the default setting though?

Anyway, again, thanks for the help!
Topic archived. No new replies allowed.