If you’re using a free coding app like Visual Studio Code that doesn’t come with a compiler, see Using MinGW instead to learn how to set up MinGW, a GCC compiler for windows.

Visual Studio 2019: Select C++ from the “Language” menu, Windows from the “Platform” menu, and then Console as the “Project type. " Select Console App, click Next, enter a project name, and then click Create. Visual Studio 2017: Click Windows Desktop and then Windows Console Application. Type a name for the project and click OK. [2] X Research source

If you have any . H files, add them to the “Header Files” directory.

To test your program from Visual Studio, click the Debug menu and select Start without debugging. To test it from the File Explorer, right-click the name of your app in the Solution Explorer window, select Open Folder in File Explorer, and then double-click the Debug folder—you’ll find your app here.

Click Downloads in the left panel. Click the blue-and-white button with a Windows logo below your operating system. If the file doesn’t download immediately, click Save to download it now.

If you install MinGW to a different folder, make note of which folder it is so you can properly set your environment variables.

If you install MinGW to a different folder, make note of which folder it is so you can properly set your environment variables.

If you install MinGW to a different folder, make note of which folder it is so you can properly set your environment variables.

If you install MinGW to a different folder, make note of which folder it is so you can properly set your environment variables.

Select Basic Setup in the left column. Select all of the options in the right column and mark them all for installation as prompted. Click the Installation menu and select Apply Changes. Click Apply to start the download. When the download is complete, click Close.

Double-click Path under “System Variables” in the bottom section. Click the New button at the top-right corner. Type C:\MinGW\bin into the blank and click OK. Click OK again and close all open windows.