一、下载mingw-64
参考博客:
下载完成后如下所示:
二、官网下载安装vscode
三、vscode中安装插件和配置
1.安装插件C/C++,C/C++ Compile Run
"C_Cpp.intelliSenseEngineFallback": "Disabled", //需要添加的 "C_Cpp.intelliSenseEngine": "Tag Parser", // 需要添加的
#include<stdio.h> int main(){ char name[100]; printf("What is your name?\n"); scanf("%s",name); printf("Hello,%s,nice to meet you!\n",name); return 0; }
运行方式1(C/C++ Compile Run):按F6键运行
运行方式2(命令行):g++ -o ouput filename.cpp
配置c_cpp_properties.json(Ctrl+shift+p,搜索C/C++打开,如下所示)
g++ -v -E -x c++ -