How to Install VS Code or VS Code Insiders
You have to download Visual Studio Code directly from the official website: https://code.visualstudio.com/.
If you want, you can also install VS Code Insiders, and the same process is applicable for that as well.
Visual Studio Code Insiders is actually the “Insiders” build of Visual Studio Code, which contains all the latest features that are shipped daily. You can think of VS Code as the stable release and the VS Code Insiders as the Insiders release of that.
If you want to experience the latest updates instantly, then you might also try Visual Studio Code Insiders (I use it myself). For downloading VS Code Insiders, you can visit the official website for VS Code Insiders here: https://code.visualstudio.com/insiders/
Make sure to download the exact file for your operating system.
![image-163](https://www.freecodecamp.org/news/content/images/2023/01/image-163.png)
![image-164](https://www.freecodecamp.org/news/content/images/2023/01/image-164.png)
The installation process is pretty basic. But I am going to show you all the steps sequentially. For now, I am going to show you the installation process using VS Code Insiders, but everything you will see here is going to be exactly the same for VS Code as well.
Make sure to click the box on the “I accept the agreement ” box and click on Next.
![image-165](https://www.freecodecamp.org/news/content/images/2023/01/image-165.png)
Keep everything as it is. Do not change anything from here.
![image-168](https://www.freecodecamp.org/news/content/images/2023/01/image-168.png)
Click Next. Again, simply click Next.
![image-170](https://www.freecodecamp.org/news/content/images/2023/01/image-170.png)
Make sure to add the checkmark (✔) on all of the boxes. Then click on Next.
![image-171](https://www.freecodecamp.org/news/content/images/2023/01/image-171.png)
Click on Install.
![image-172](https://www.freecodecamp.org/news/content/images/2023/01/image-172.png)
It might take a little time to finish the installation.
![image-173](https://www.freecodecamp.org/news/content/images/2023/01/image-173.png)
Click on Finish.
![image-175](https://www.freecodecamp.org/news/content/images/2023/01/image-175.png)
Congrats – you’ve successfully installed VS Code/VS Code Insiders on your system. Now, cheers! 🥂
How to Prepare VS Code/VS Code Insiders For C and C++ Code
First, open VS Code or VS Code Insiders.
Go to the Extension tab. Search for “C” or “C++” and install the first one that is already verified by Microsoft itself.
![image-178](https://www.freecodecamp.org/news/content/images/2023/01/image-178.png)
Also, install C/C++ Extension Pack. It should also be verified by Microsoft.
![image-179](https://www.freecodecamp.org/news/content/images/2023/01/image-179.png)
Then you have to search for Code Runner and install the extension as well.
![image-180](https://www.freecodecamp.org/news/content/images/2023/01/image-180.png)
Now, we need to change some settings.
![image-177](https://www.freecodecamp.org/news/content/images/2023/01/image-177.png)
Click the gear box (It is called the Manage section), and then click Settings. Alternatively, you can also use the shortcut keys Ctrl
+ ,
. You need to replace the Ctrl
key with the Command key for Mac.
![image-182](https://www.freecodecamp.org/news/content/images/2023/01/image-182.png)
In the search bar, type “Run code in terminal” and press the Enter key.
Scroll down a little bit until you find Code-runner: Run In Terminal
. Make sure that the box is checked (✔).
![image-184](https://www.freecodecamp.org/news/content/images/2023/01/image-184.png)
Now you need to restart your VS Code/VS Code Insiders. Simply close and reopen the program.
How to Test Your Code
Simply open VS Code/VS Code Insiders, open any folder, and create any file with the extension .c
for the C file and .cpp
for the C++ file.
After writing your code, you can run the code directly using the play button you’ll find in the upper right corner.
![](https://blog.softhubsolution.com/wp-content/uploads/2024/07/image-13-1024x576.png)
It will compile and then run the code directly. After running a code, the code runner button would be set default to run directly. So, your computer is 100% ready for compiling and running any C/C++ programming code.