Sign in to follow this  

simple C++ question

This topic is 3665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im currently working with looping and in this code, and previous coding i do, whenever i run the program and then hit the enter button to input data the screen always goes away immediatly does anyone have the coding to make the screen not go away whenever i hit enter? thanks

Share this post


Link to post
Share on other sites
If there is nothing to make the program wait then the program is running throught and exitting when it reaches the end of the program after you hit enter. A simple way to fix this would be to add a section at the very end that asks for input before it exits so you can see the result of the code and press enter again to exit.

Share this post


Link to post
Share on other sites
If you are using Visual C++ Express/Visual Studio you can use Ctrl+F5 to start without debugging, this will add a "Press Any Key To Continue" to the end of your program leaving it up until you hit a button.

Alternatively you can navigate to the executable in a command prompt and load it from there, it will allow you to view the output after the program exits.

Share this post


Link to post
Share on other sites

This topic is 3665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this