Preventing console window from closing on Visual Studio C/C++ Console application

前端 未结 21 2043
灰色年华
灰色年华 2020-11-21 23:42

This is a probably an embarasing question as no doubt the answer is blindingly obvious.

I\'ve used Visual Studio for years, but this is the first time I\'ve done any

21条回答
  •  我在风中等你
    2020-11-22 00:18

    Either use:

    1. cin.get();

    or

    1. system("pause");

    Make sure to make either of them at the end of main() function and before the return statement.

提交回复
热议问题