Linux g++ C++ 用の system("pause") 2024-6-25 • c++ g++ Windows ではコンパイル時に system("pause") が機能しますが、Linux では同等のものは何ですか? 答え1 以下は Windows および Linux/Unix で動作します: std::cout << "Press \'Return\' to end." << std::endl; std::cin.flush(); std::cin.get(); 最初のコマンドstd::cin.flush()は入力キューをクリアし、次のコマンドは入力を待機します。 関連情報