What is the Best Practice for Combating the Console Closing Issue?

前端 未结 10 1698
悲&欢浪女
悲&欢浪女 2020-11-27 22:21

After compiling console programs the console window closes immediately after running. What is the best practice for keeping it open? I\'ve searched google loads, I\'m used t

10条回答
  •  遥遥无期
    2020-11-27 22:54

    Run your program in a console, which would be the expected way of running a console program ...

    Alternatively, you can make a little batch file to execute your program that would have:

    REM batch file to launch program
    yourprogram.exe
    PAUSE
    

    and the PAUSE cmd.exe command will ask to user to press any key.

提交回复
热议问题