VS Code 的 C/C++ 配置
现在点一点鼠标就可以了,真是轻松加愉快
我假设你已经成功安装了 MinGW-w64 与 Clang,并将它们添加到了 Path 里,并且使用 cmd 或者 powershell 作为集成终端。
配置编译与调试
首先用 VS Code 打开一个空文件夹,然后按下 F1 ,输入 C/C++: Edit configurations (UI) ,进入 C/C++ 插件的设置界面。

在 Compiler path 中选择你的 g++ 的所在路径,当然也可以选择 Clang 。
至此, 编译的配置已经完成。按下 F1 ,输入 C/C++: Build and Debug Active File ,选择用 g++ 编译,即可查看效果。
配置 IntelliSense
只需要调整 IntelliSense mode ,可以选择 Clang 或者 gcc 。
配置代码格式化
如果你安装了 Clang ,并将其加入 Path ,那么 VS Code 会自动使用 clang-format 来格式化代码。如果你认为它的格式化不尽人意,可以在文件夹里添加 .clang-format 文件,以下是我的示例:
---
BasedOnStyle: LLVM
IndentWidth: 2
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
AlignConsecutiveAssignments: true
AlignOperands: true
BreakBeforeBraces: Attach
---
这样,你只需要打开文件夹,然后在这个文件夹里写自己的代码,就可以享受到各种快乐了。
navigate_before
ST Monad 与 Rank N Types
无旋 Treap
navigate_next