安装步骤
1.安装Mingw
安装地址
- 官网http://www.mingw.org/;
- 本人百度网盘
链接:https://pan.baidu.com/s/1v7Dt7dE86bQD1JuEl7m-UA
提取码:s9w4 - 具体安装过程可参考https://www.cnblogs.com/TAMING/p/9945389.html
2.vscode配置环境
(1)打开vscode,新建一个目录;具体如下,新建cpp文件(c++)
(2)测试代码
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
cout << "hello vcscode" << endl;
for(int i=0;i<3;i++)
cout << i << endl;
printf("hello world\n");
return 0;
system("pause");
}
(3)添加环境
选择最后一项
(4) 修改launch.json文件
修改前后变化如图所示;
(5)点击左上角调试,弹出以下对话框,点击配置任务
点击模板r
选择othe
task文件修改前后内容如图所示;
(6) 设置断点调试即可
效果如图所示
转载请注明转载地址;