DEV Community

Cover image for How to Write And Run C and C++ Code in Visual Studio Code
Md. Fahim Bin Amin
Md. Fahim Bin Amin

Posted on


How to Write And Run C and C++ Code in Visual Studio Code

For a pretty long time, I was hearing many complaints from a lot of people that they are failing to run their C/C++ codes directly from the Visual Studio Code.

So, I thought about writing a full-fledged article on this on freeCodeCamp.

You need to check something sequentially. I am providing those step by step here:

  1. You have to ensure that you have correctly installed the compiler for the C/C++ program whether you are using a Windows, Linux or Mac based operating system.
  2. You have to check whether your compiler is working correctly or not. If you are a Windows user, then you also need to ensure that you have added the compiler's directory to the environment path variables. For this, make sure to check this article.

    How to Install C and C++ Compilers on Windows

    If you want to run C or C++ programs in your Windows operating system, then you need to have the right compilers. The MinGW compiler is a well known and widely used software for installing GCC and G++ compilers for the C and C++ programming languages. But many

  3. I can pretty much assume that you have already ensured that your machine has the compiler installed and configured successfully if that passes the previous point. Now, it is time to install and configure the VS Code properly. For this, simply head over to this article.

    How to Write And Run C and C++ Code in Visual Studio Code

    Visual Studio Code (or VS Code for short) is a very common and widely used text editor and IDE (Integrated Development Environment). You can make VS Code very powerful like an IDE using a lot of extensions. Before approaching the process of running your first C or C++ code on


That's it! 😀

You may follow me on:
➡ Twitter: Fahim_FBA
➡ LinkedIn: fahimfba
➡ GitHub: FahimFBA
➡ English YouTube Channel: Fahim Bin Amin - English
➡ Bengali YouTube Channel: Fahim Bin Amin - Bengali
➡ Blog (Powered by Hashnode): Articles and Contents by Fahim
➡ Website:

Top comments (0)

Here is a post you might want to check out:

Regex for lazy developers

regex for lazy devs

Sorry for the callout 😆