Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

console

Status
Not open for further replies.

jimjake

Technical User
Oct 30, 2004
25
US
I wrote a program, and it works fine. It’s a console program. When I run it under my compiler it stops and says press enter to return. When I run it outside the program executes and the console window with the information disappears in a split second, there is no chance to read it. Is there away to keep the console active until I can get the information…… the program uses std::cout and std::cin .....Jim
 
Yeah, just #include <conio.h> and use getch(), it will pause until the user presses a key.
 
Or try more simple and robust:
Code:
system("pause"); // system() from <cstdlib>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top