Jump to content
  • Advertisement
Sign in to follow this  
sripimyrz

simple C++ question

This topic is 3971 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
Advertisement
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
You could use OutputDebugString instead of printf so that it appears in msdev output window

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!