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

前端 未结 21 1662
灰色年华
灰色年华 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-21 23:56

    You can also use this option

    #include  
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */
    int main() {
       .
       .
       .
       getch(); 
    
       return 0;
    }
    

提交回复
热议问题