Programming Wiki: C Pause

Programming Wiki : CppPause

WikiHomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

C++ Pause

Cpp


Windows Specific Pause for any key
system("PAUSE");


Generic c++ Manipulating cin to pause for anykey
void pause()
{
    std::cin.clear();
    std::cin.ignore(std::numeric_limits<std::streamsize>::max()); //
    // Clear whatever's still in the buffer
    std::cout << "Press Enter to continue . . .\n";
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}

There are no comments on this page. [Add comment]

Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0222 seconds