Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>C++ Studio WebNew to Visual Studio Code? Get it now.
C++ Studio Web

C++ Studio Web

Yqloss

| (0) | Free
Run single-file C++ locally in VS Code Web with WASM Clang and clangd.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C++ Studio Web

  1. 在 VS Code 中通过 Extensions → … → Install from VSIX… 安装插件,打开单个 .cpp 文件。也可执行 C++ Studio: Open Example 打开示例。
  2. 在编辑器按 F5 或点击右上角 ▶ 编译运行。
  3. 在 Input / Output 面板填写 stdin;勾选 Interactive 后使用 Send / EOF 提供交互输入,Stop 停止程序。
  4. 在 Flags 中填写编译参数,默认 -std=c++20 -O2 -DLOCAL -Wall;用 -std= 更改标准。查看调用栈时可改为 -O0。
  5. 使用编辑器的补全、错误悬浮提示,以及 Format Document(Windows:Shift+Alt+F)格式化代码。语言服务异常后会自动重启,重新加载期间仍可使用已有补全缓存。
  6. 勾选 Expected stdout 输入预期输出,按空白分隔 token 比较;黄色背景表示不同。点击 token 或滚动可联动两侧。stderr 显示为红色且不参与比较。
  7. 编译失败会自动展开 Compiler diagnostics。点击一行选中,使用 Next error / Previous error 跳到后方 / 前方的错误;未选中时选择第一个 / 最后一个。自动展开的面板在下次编译通过后收起。

使用单文件 WASM C++ / libc++ 工具链,无需安装本机编译器。支持 bits/stdc++.h,不支持多文件项目构建、C++ 异常处理和宿主系统 API。

在 vscode.dev 中,可通过命令 Developer: Install Extension From Location... 从支持 CORS 的 HTTPS 静态地址加载插件。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft