Here\'s a question that I don\'t quite understand:
The command, system(\"pause\");
is taught to new programmers as a way to pause a program and wait for
You can use std::cin.get()
from iostream
:
#include // std::cout, std::cin
using namespace std;
int main() {
do {
cout << '\n' << "Press the Enter key to continue.";
} while (cin.get() != '\n');
return 0;
}
Besides, system('pause')
is slow, and includes a file you probably don't need: stdlib.h
. It is platform-dependent, and actually calls up a 'virtual' OS.