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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pause for "any key". 1

Status
Not open for further replies.

classic773

Programmer
Jun 14, 2001
57
US
How do I make my program pause until any key is pressed. My best is cin >> char, but that doesn't work for the enter key. I think it would if I could get it to input whitespace. Is there another way?
 
Use get function.

#include <iostream.h>

int main()
{
char a = cin.get();
return 0;
}

Maniraja S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top