# VS Code C/C++ Extension — IntelliSense and Debugging for C and C++ > Microsoft's official VS Code extension providing IntelliSense, debugging, code browsing, and refactoring for C and C++ projects on any platform. ## Install Save as a script file and run: # VS Code C/C++ Extension — IntelliSense and Debugging for C and C++ ## Quick Use ```bash code --install-extension ms-vscode.cpptools # Open a C/C++ project folder in VS Code # IntelliSense activates automatically for .c, .cpp, .h files ``` ## Introduction The C/C++ extension by Microsoft brings full-featured IntelliSense, debugging, and code navigation to Visual Studio Code. It transforms VS Code into a capable C and C++ IDE with support for GCC, Clang, and MSVC toolchains across Linux, macOS, and Windows. ## What the C/C++ Extension Does - Provide context-aware code completion and parameter hints for C/C++ - Enable breakpoint debugging with GDB, LLDB, and the Visual Studio debugger - Navigate code with Go to Definition, Find All References, and Call Hierarchy - Display inline diagnostics and compiler errors as you type - Support CMake, Makefile, and compile_commands.json project configurations ## Architecture Overview The extension runs a language server process that parses your C/C++ source files and headers using a custom IntelliSense engine. It reads compilation databases or user-configured include paths to resolve symbols accurately. For debugging, it communicates with GDB or LLDB through the Debug Adapter Protocol, providing a graphical debug experience in the VS Code UI. ## Self-Hosting & Configuration - Install from the VS Code marketplace; works on Linux, macOS, and Windows - Configure include paths and compiler settings in `c_cpp_properties.json` - Point to a `compile_commands.json` for accurate project-wide IntelliSense - Set up launch configurations in `launch.json` for debugging - Pair with the CMake Tools extension for seamless CMake project integration ## Key Features - IntelliSense engine provides accurate completions even in large codebases - Integrated debugging supports conditional breakpoints, watch expressions, and memory inspection - Code formatting with clang-format integration and configurable styles - Header/source switching with a single keyboard shortcut - Remote development support via SSH, containers, and WSL ## Comparison with Similar Tools - **CLion** — full C++ IDE by JetBrains; VS Code C/C++ is free and lighter weight - **clangd** — alternative language server; the Microsoft extension offers tighter VS Code integration - **Eclipse CDT** — Java-based IDE; VS Code provides a faster, more modern editing experience - **Code::Blocks** — standalone C++ IDE; VS Code offers a larger extension ecosystem ## FAQ **Q: Which compilers are supported?** A: GCC, Clang, and MSVC on their respective platforms. The extension auto-detects installed compilers. **Q: Can I use it with CMake projects?** A: Yes. Install the CMake Tools extension alongside it for full CMake integration including build, test, and debug. **Q: How do I fix IntelliSense errors?** A: Ensure your include paths are correctly configured in `c_cpp_properties.json` or provide a `compile_commands.json` file. **Q: Does it support C++20 and C++23 features?** A: Yes. Set the `cppStandard` property in your configuration to enable modern C++ standard support. ## Sources - https://github.com/microsoft/vscode-cpptools - https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools --- Source: https://tokrepo.com/en/workflows/asset-fda37ff6 Author: Script Depot