For a windows solution, you could try this which will allow the user to press any key to continue (not just enter): void Pause(char.message = 'Press any key to continue. ') std::cout. Press any key to continue. This is typically a problem on Windows, caused by really dumb IDEs that don't know enough to keep the console open after the program finishes. However, it does strike right at one of the main philosophical problems with the way you are thinking about programming.
I've been looking around the site for an answer to this, only thread i've found pertaining to it was this:
and that thread wasn't very helpful, so, i'm sorry if it's been asked before somewhere.
AFinitDataCallback(key: 'ds:17', isError: false, hash: '25', data:functionreturn 'gp:AOqpTOGBoMNWE6MasY0b0-rZOUBUxvwxJ5GxYwOwsWMD2jmFvBVKLaKCC5Z7mzNAP16EwSqULWKjvA-3tvg','D Rosalinda',null,2,null,null,null,'came back to this app a go three times over the last 2 years because I really wanted it to work. Edit: Thank you developer for the reply, it shows that you care. Reclaiming my time auto tune. Each time I tried, I spent a couple of hours trying to navigate around the features and failed to get anything out of it. Incredibly unintuitive, no in app explanation, and the online 'getting started page' doesn't explain much on what each features do.
anyway, onto my question:
The title was pretty self explanatory, I want to know a specific function that I can use to make it so that the user has to press a key before the program continue's running, *AND*, I want to be able to dictate what is said when it asks the user to press any key. So instead of it saying 'Press any key to continue', I can make it say 'Enter a digit' or whatever I want it to say.
Right now I'm using the function System ('PAUSE'), and I'd prefer not to use this.
Thanks for any assistance.
There are several ways of doing what you want to do here. I'm sure that I have omitted some, but these will work:
I'm VERY inexperienced in programming, I'm just learning the very basics. Anyways, I just figured out how to add a 'pause' line to keep the program from closing as soon as I run it, but now there's a nasty 'Press any key to continue' after my text. Is there a way to hide this? Thanks in advance. :)
I assume you're using
system ( 'PAUSE' ) . My first inclination is to say that this solution is a bad idea anyway, and if it doesn't do exactly what you want, that's all the better for convincing you not to use it. :D
The usual recommendation for pausing a program from an IDE that terminates the hosting console when the program ends is to ask for input. For example, the following code won't terminate until you press the Enter key:
You'll eventually have problems with existing data in the stream causing this not to work, but we have a '>sticky on this forum that teaches you how to deal with that.