https://code.visualstudio.com/docs/languages/cpp
- C++ is a compiled language meaning your program’s source code must be translated (compiled) before it can be run on your computer.
- C++是个编译型编程语言,意味着必须将源代码翻译才能被计算机运行
- VS Code is first and foremost an editor, and relies on command-line tools to do much of the development workflow
- VS Code首先只是一个编辑器,依赖命令行工具来完成大部分开发工作流
- The C/C++ extension does not include a C++ compiler or debugger. You will need to install these tools or use those already installed on your computer.
- C/C++扩展并不包含一个C++编译器或者调试器,你需要自己安装这些工具
打开vscode,按Ctrl+`打开终端
GCC complier
g++ --version
Clang complier
若有信息输出,则已经配置完毕
选择 终端 > 运行生成任务(或者Ctrl+Shift+B
)
选择gcc.exe build active file
然后就可以看见生成了对应的.exe文件
打开终端输入
.\文件名