|
-
Dec 24th, 2000, 06:19 PM
#1
Thread Starter
Fanatic Member
For example, at the end of a program it says "Press any key to continue", but you can't really see any output because it closes too fast. Is it possible to have the program wait for a keypress before proceeding?
-
Dec 24th, 2000, 06:34 PM
#2
Code:
#include <conio.h>
#include <iostream.h>
int main()
{
//do stuff here.
//end of program
cout << "Press any key to continue";
getch();
return 0;
}
-
Dec 25th, 2000, 01:02 PM
#3
Frenzied Member
At the very end of your main() function, put:
Code:
#include <stdlib.h>
....
system("pause");
return 0;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|