One of the first things I learned in C++ was that
#include <iostream>
int main()
{
std::cout<<"Hello, World!
";
return 0;
}
would simply appear and disappear extremely quickly without pause. To prevent this, I had to go to notepad, and save
helloworld.exe
pause
ase
helloworld.bat
This got tedious when I needed to create a bunch of small test programs, and eventually I simply put while(true);
at the end on most of my test programs, just so I could see the results. Is there a better wait function I can use?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…