Facebook PixelHow to Install & Setup VS Code for running C++ Programs | Blog | CodeWithHarry
How to Install & Setup VS Code for running C++ Programs

How to Install & Setup VS Code for running C++ Programs

"To run C++ programs in Visual Studio Code, first, you need to download and install the VS code on your computer.  Follow the steps given below..."

By CodeWithHarry

Updated: 5 April 2025

To run C++ programs in Visual Studio Code, you need to download and install VS Code on your computer.

Follow the steps given below:

Step 1: Download VS Code by clicking here.

Step 1

Step 2: Install VS Code as soon as the downloading completes.

Step 3: To compile C++ programs, you need to install the MinGW compiler. Click here, and downloading will start shortly.

Step 3

Step 4: Install the MinGW compiler.

Step 4

Step 5: Now, you need to add MinGW to the path. Go to This PC → C:/ → Program Files (x86) → mingw-w64 → i686-8.1.0-posix-dwarf-rt_v6-rev0 → mingw32 → bin.

Step 5

Step 6: Copy the path and paste it in the environment variables. Right-click on This PCPropertiesAdvanced System SettingsEnvironment variables.

Step 7: Click on the path and then EditNew. Paste the copied path here and click 'ok.'

Step 7

Step 8: Now, open VS Code and download the C/C++ extensions as shown in the below animation:

Step 8

Step 9: To run the C++ programs easily on VS Code, you need to install another extension called “Code Runner.”

Step 9

With this, you are all set to run your C++ programs in VS Code. Let’s write a Hello World program to make sure that everything is working correctly.

Hello World

In the above animation, you can see that the Hello World program is running correctly. So, that’s how you can easily set up VS Code to run C++ programs on your computer.

Tags

setupcppforvscode