๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ languages โ€บ cpp
C/C++ for Visual Studio Code
November 3, 2021 - Find out how to get the best out of Visual Studio Code and C++.
๐ŸŒ
Reddit
reddit.com โ€บ r/c_programming โ€บ what tools do you use with visual studio code to run c code ?
r/C_Programming on Reddit: What tools do you use with Visual studio code to run C code ?
July 29, 2022 -

I followed what is said on this blog post, it takes so much time to run(or build) and sometimes just doesn't.

i've been using CodeBlocks before but didn't get comfortable with it i just don't like, it would be great if i can use VSC.

Edit: i use Windows.

๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
C/C++ - Visual Studio Marketplace
Extension for Visual Studio Code - C/C++ IntelliSense, debugging, and code browsing.
๐ŸŒ
YouTube
youtube.com โ€บ watch
How to Setup C/C++ in VS Code [Updated 2025] Complete Installation with example | Amit Thinks - YouTube
Learn how to setup and run C/C++ on VS Code. We will also run an example C file after the setup.C Tutorial (English): https://youtu.be/CobHIiQXMtQC Tutorial ...
Published: January 15, 2025
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 65598881 โ€บ how-to-compile-c-program-in-visual-studio-code
How to compile C program in Visual Studio Code? - Stack Overflow
compilation ยท vscode-debugger ยท Share ยท Improve this question ยท Follow ยท edited Jan 6, 2021 at 15:52 ยท asked Jan 6, 2021 at 15:45 ยท anotherOne ยท 1,67933 gold badges1616 silver badges2525 bronze badges 2 ยท Use GCC after having read its documentation (e.g.
๐ŸŒ
SourceForge
sourceforge.net โ€บ projects โ€บ c-c-for-visual-studio-c.mirror
C/C++ for Visual Studio Code download | SourceForge.net
September 9, 2026 - This is an exact mirror of the C/C++ for Visual Studio Code project, hosted at https://github.com/microsoft/vscode-cpptools.
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ cpp โ€บ config-msvc
Configure VS Code for Microsoft C++
November 3, 2021 - VS Code is now configured to use the Microsoft C++ compiler. The configuration applies to the current workspace. To reuse the configuration, just copy the JSON files to a .vscode folder in a new project folder (workspace) and change the names of the source file(s) and executable as needed.
Find elsewhere
๐ŸŒ
Medium
medium.com โ€บ @ochwada โ€บ c-programing-setup-in-visual-studio-code-bd4cb60e58ff
C Programming โ€” Setup in Visual Studio Code | by Ochwada | Medium
November 16, 2024 - Low-Level Access: C provides low-level memory manipulation via pointers and direct interaction with hardware.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-write-and-run-c-cpp-code-on-visual-studio-code
How to Write And Run C and C++ Code in Visual Studio Code
January 20, 2023 - For running C or C++ code, you just need to have a valid C/C++ compiler installed on your computer. If you are using a Linux operating system, then there is a high chance that it is already installed on your system.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-setup-vscode-with-c-c-and-python-for-competitive-programming
How to Setup VSCode with C, C++ and Python for Competitive Programming - GeeksforGeeks
July 15, 2025 - This article will show you how to, fetch test cases directly from the browser without copy-pasting and run them in VSCode with just 2 clicks, create your own Snippets, and use the powerful Debugger.
๐ŸŒ
GitHub
github.com โ€บ microsoft โ€บ vscode-cpptools
GitHub - microsoft/vscode-cpptools: Official repository for the Microsoft C/C++ extension for VS Code. ยท GitHub
The C/C++ extension adds language support for C/C++ to Visual Studio Code, including editing (IntelliSense) and debugging features.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 79048119 โ€บ how-to-run-c-in-vs-code
How to Run C in VS Code - Stack Overflow
1. Verify that the code is being compiled, and an executable is being created. A simple GCC command like gcc main.c -o main.exe will work. 2. Make sure the executable main.exe is mentioned in your launch.json file in the .vscode folder of your project.
๐ŸŒ
Medium
ludwiguer.medium.com โ€บ configure-visual-studio-code-to-compile-and-run-c-c-3cef24b4f690
Configure Visual Studio Code to compile and run C/C++ | by Luis Guerrero | Medium
April 6, 2020 - Configure Visual Studio Code to compile and run C/C++ Some time ago a friend of mine asked me to recommend her an IDE to compile and run C and C++ code because she was tired of using XCode, and I โ€ฆ
๐ŸŒ
PW Skills
pwskills.com โ€บ blog โ€บ cpp โ€บ c-programming-in-vs-code
Can I Use C Programming in VS Code? Explained in Detail!
October 30, 2025 - In this blog, we'll talk about the compatibility of C programming with VS Code, the role of C++ compilers, and provide step-by-step instructions on running C programs in VS Code on various operating systems.
๐ŸŒ
DEV Community
dev.to โ€บ haythammostafa โ€บ run-c-code-in-visual-studio-code-2j86
Run C Code in Visual Studio Code - DEV Community
July 3, 2023 - C is very close to hardware and can directly interact with it(managing memory). The C code you write is converted into assembly language by the compiler and then run as instructions on the hardware.
Top answer
1 of 1
5

To run a C program in Visual Studio Code, follow these steps:

  1. Install the C/C++ Extension: Ensure you have the C/C++ extension installed in Visual Studio Code. You mentioned you have this set up, which is great.
  2. Set Up a Workspace: Create a new folder for your C projects. Open Visual Studio Code and select File > Open Folder... to open your newly created folder.
  3. Create a C File: Inside your workspace folder, create a new file with a .c extension (e.g., hello.c). You can do this by right-clicking in the Explorer pane and selecting New File.
  4. Write Your Code: Write your C code in the newly created file. For example:
       #include 
       
       int main() {
           printf("Hello, World!\n");
           return 0;
       }
    
  5. Configure Build Tasks: You need to set up a build task to compile your C code. Press Ctrl + Shift + B to open the build tasks menu. If prompted, select Create tasks.json file from template and choose Others. Modify the generated tasks.json file to include the following:
       {
           "version": "2.0.0",
           "tasks": [
               {
                   "label": "build",
                   "type": "shell",
                   "command": "gcc",
                   "args": [
                       "-g",
                       "${file}",
                       "-o",
                       "${fileDirname}/${fileBasenameNoExtension}"
                   ],
                   "group": {
                       "kind": "build",
                       "isDefault": true
                   },
                   "problemMatcher": [
                       "$gcc"
                   ],
                   "detail": "Generated task by gcc"
               }
           ]
       }
    
  6. Build Your Program: Press Ctrl + Shift + B again to build your program. This will compile your C code and create an executable in the same directory.
  7. Run Your Program: Open the terminal in Visual Studio Code (View > Terminal or `Ctrl + ``) and run your program by typing:
       ./hello
    
    (Replace hello with the name of your executable if different.)
  8. Debugging: To debug your program, you will need to set up a launch configuration. Go to the Run view (left sidebar) and click on create a launch.json file. Choose C/C++: g++ build and debug active file. This will create a launch.json file where you can configure debugging settings.
  9. Start Debugging: Set breakpoints in your code by clicking in the gutter next to the line numbers. Then, press F5 to start debugging your program.

By following these steps, you should be able to set up Visual Studio Code for C programming and run your code successfully.


References:

  • Walkthrough: Compile a C program on the command line
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ cpp โ€บ cpp-ide
Editing and Navigating C++ Code
November 3, 2021 - How to edit and navigate C++ source files in Visual Studio Code.