c++ press any key to continue code example
Example 1: c++ wait for user input
cin.get() //(expected for Enter, need #include <iostream>).
Example 2: c++ press any key
// On Windows:
system("pause");
// and on Mac and Linux:
system("read");
cin.get() //(expected for Enter, need #include <iostream>).
// On Windows:
system("pause");
// and on Mac and Linux:
system("read");