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.

Dev C++ Press Any Key To Continue Update

Thanks for any assistance.

  • 7 Contributors
  • forum 11 Replies
  • 300 Views
  • 1 Day Discussion Span
  • commentLatest Postby WaltPLatest Post

MyrtleTurtle52

There are several ways of doing what you want to do here. I'm sure that I have omitted some, but these will work:

Edited by MyrtleTurtle: n/a
C++

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. :)

Dev C Press Any Key To Continue Image

  • 4 Contributors
  • forum 6 Replies
  • 3,347 Views
  • 1 Day Discussion Span
  • commentLatest Postby William HemsworthLatest Post

C++ Press Enter To Continue

Dev C++ Press Any Key To Continue

Narue5,707

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

Dev C Press Any Key To Continue Python

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:

Dev C++ Press Enter To Continue

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.