int main(int argc, char* argv[])
{
std::cout << "My first C++ program.";
std::cin.ignore();
std::cin.sync();
return EXIT_SUCCESS;
}
The best portable way IMO.
::_getch() is a nice one, but try compiling it on eg. some Linux distro. It won't work. Same thing with ::System("Pause"); and calling system functions is a bit dirty.
You'll spot the difference if you try continuing your program with some else key than enter. Eg. the button for A.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum