C / C++
About
This module contains 2 languages:
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, while a static type system prevents unintended operations.
C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or C with Classes.
Installation
Change enable from False to True in the c_cpp section (cf module installation).
Requirements
After installing this module, you must configure it because it doesn't work out of the box.
Indeed to work the module ms-vscode.cpptools needs to have a valid.vscode/c_cpp_properties.json file.
You can configure it by running the command C/C++: Edit Configurations (UI) or C/C++: Edit Configurations (JSON) from the Command Palette (Ctrl+Shift+P).


For more details read the official configuration and how to configure it with:
You could also read:
Windows examples
You can also create a task file .vscode/tasks.json to compile your program:
You can also create the .vscode/launch.json file to run the debugger:
VSCode
VSCode extensions
ms-vscode.cpptools
This extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging.

jbenden.c-cpp-flylint
This extension is an advanced, modern, static analysis extension for C/C++ that supports a number of back-end analyzer programs.
matepek.vscode-catch2-test-adapter
This extension allows you to run your Catch2, Google Test, and doctest (experimental) tests for Visual Studio Code.

ms-vscode.cmake-tools
CMake Tools provides the native developer a full-featured, convenient, and powerful workflow for CMake-based projects in Visual Studio Code.
VSCode settings
Global settings
If llvm is enabled:
Windows settings
Global settings for Windows:
If llvm is disabled:
If llvm is enabled:
Linux settings
Global settings for Linux:
If llvm is disabled:
If llvm is enabled:
VSCode keybindings
No keybindings.
Software
Windows software
msys2
if llvm is disable:
if llvm is enabled:
Linux software
brew
If llvm is disable:
If llvm is enabled:
MacOS software
brew
If llvm is disable:
If llvm is enabled:
Documentation
VSCode-Anywhere
Environment
Windows environment
No environment.
Linux environment
Specific settings
llvm
To enable llvm, set llvm to True.
Last updated
Was this helpful?