I wondering how to stop a infinite loop.
The program clears a file then opens it and refreshes it over and over(the file is going to be modified by another program).
I want it to start from the beginning anytime i press enter or escape, it doesn't really matter as long as you can restart it.
If a key is pressed, read a single character from the input. (You'll have to have unbuffered input for that.) If it is the Enter or Esc key, then break your loop. Otherwise continue.