I have this much cleaner variant to system("Pause")
that waits for the user to press enter:
#include <iostream>
void pause()
{
std::cin.get();
std::cin.ignore();
}
However, I couldn't find a clean variant to system("CLS")
(or system("clear")
), so I switched the whole application to ncurses
.
After some reading I found out that ncurses
has its own set of I/O functions and that std::cout
and std::cin
got replaced with echo()
and getch()
.
That function pause()
also has to be converted to ncurses
, but my problem is that I don't know the correct equivalent to std::cin.ignore
.