>what's a more efficient way to pause the program until keypress?
The best portable way is:
The call to ignore will clean up any extraneous characters from the stream so that get actually causes a blocking read. If your stream usage is well thought out then this shouldn't be a problem though.
using namespace std;
If you want to terminate the program at any key press rather than just at Enter, you get into the realm of implementation dependent solutions. In that case, the question becomes "How can I read a key press without waiting for Enter?".