Archived

This topic is now archived and is closed to further replies.

Trouble with command prompt

This topic is 5153 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

I am having trouble with a small program, a feet to meters converter program... The code is ok, except that after you input 3 values in meters, the length in feet shows up.. only problem is, the command prompt closes after that, thinking that everything is done... I am learning this project from the book "Game Programming All in One" and the images in the book show that his command prompt says "Press any key to continue" I copied his code EXACTLY, and have even used the cd in the book and it does the same thing. What can i do?

Share this post


Link to post
Share on other sites
Well, you could...

A: Run it from the command prompt rather than Windows Explorer.

B: Put System("PAUSE") at the end of your program and include Windows.h (not an option if you aren''t using windows, obviously).

C: cin >> to a temporary variable so that the user needs to enter in a value.

D: Use Microsoft Visual Studio if you''re a rich poser.

Share this post


Link to post
Share on other sites