
To execute your code, click the Run button on the top right. Press Ctrl + S on your keyboard to save the file. For this tutorial, I will use this code to print a simple “Hello World” message: Write, or paste your code into the editor.
I will name it HelloWorld.cNote:Alternatively, you can select the folder+ icon and select the folder which contains your C or C++ project to import it. Then, type the source file name with the. Create a new source file by clicking on the New File icon. Paste the copied path here, then click OK.
Paste the copied path here and select OK. Select Path under the “Variable” column. Search for “path” and select Edit the system environment variables. By default, it is C:\MinGW\bin.Ĭopy the path of the bin folder inside the MinGW folder.įrom the start menu, search for “Path.” Then, select Edit the system environment variables option. Copy the path of the bin folder inside the MinGW folder. In the Installation menu, select Apply Changes.īefore running your C or C++ program, you must add the MinGW bin directory to your system path. From the top-level Installation menu, select Apply Changes. Under the Basic Setup tab, select mingw32-GCC-g++.įrom the Basic Setup section, choose the mingw32-GCC-g++ option. Launch the newly-installed MinGW application. When the installation is complete, click on Quit.Ĭlick on Quit after installation completion.
Keep the default path and select Continue. Keep the default path for installation.Go to /projects/mingw and download the MinGW setup.You can skip until Step 3 if you are using Linux or Mac. Using Windows, I will show you how to download and configure MinGW.
On Linux, you can use the native GCC (GNU Compiler Collection).On Windows, you can use MinGW or Microsoft Visual C++.To start writing C/C++ code in VS Code, you need to install a C and C++ compiler. Step 1: Download and install C or C++ compiler This article will show you how to run a C and C++ Program In Visual Studio Code. C and C++ are widely used general-purpose programming languages.