1、打开VS,新建一个C++文件,编写一段简单的代码,如下所示#include<iostream>using namespace std;int main(){ cout<<"hello!world"; return 0;}
2、运行调试控制台会一闪而过,在输出代码下面添加getchar();如下所示#include<iostream>using namespace std;int main(){ cout<<"hello!world"; getchar(); return 0;}
3、保存运行,控制台不再一闪而过。