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

1

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

    favicon freecodecamp.org
  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

    favicon freecodecamp.org

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: fahimbinamin.com

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more