C++ Getting Started
To start with, I’ll be covering these things in today’s tutorial:
C++ Install IDE
An IDE (Integrated Development Environment) is used to edit AND compile the code.
Popular IDE's include Code::Blocks, Eclipse, and Visual Studio. These are all free, and they can be used to both edit and debug C++ code.
Note: Web-based IDE's can work as well, but functionality is limited.
We will use VS Code in our tutorial, which we believe is a good place to start.
C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.
We will install Mingw-w64 via MSYS2, which provides up-to-date native builds of GCC, Mingw-w64, and other helpful C++ tools and libraries. You can download the latest installer from the MSYS2 page or use this link to the installer.
Add the path to your Mingw-w64
bin folder to the Windows
PATH environment variable by using the following steps:
Pathvariable in your User variables and then select Edit.
\mingw64\binappended, to the system path. The exact path depends on which version of Mingw-w64 you have installed and where you installed it. If you used the settings above to install Mingw-w64, then add this to the path:
C++ Start Now with code
Let's create our first C++ file.
Open VS Code and go to File > New > Empty File.
Write the following C++ code and save the file as p1.cpp (File > Save File as):
For Example: C++ program to display "Hello World! Welcome to OPH"
Output: Hello World! Welcome to OPH