Course Content

Introduction to C++, Installing VS Code, g++ & more | C++ Tutorials for Beginners #1

In these C++ tutorials, we are going to learn the C++ programming language. First of all, I am going to explain how these C++ tutorials will differ from other sources of learning C++:

  1. These C++ tutorials will cover everything in C++ from beginning to the end.
  2. No repetitive and useless stuff
  3. Enjoyable and easy to learn.
  4. I have designed this C++ course for absolute beginners.
  5. No prior programming knowledge required.
  6. The course will include quizzes with solutions.

Here is the content outline which we are going to cover in today's C++ tutorial:

  • What is programming, and why C++?
  • Installation of Visual Studio Code
  • Installation of g++
  • Writing our first program and executing it

What is Programming and Why C++?

Before starting this C++ tutorial, we should know the reason behind learning a programming language? Let me answer this fundamental question for you. A programming language helps a user to communicate with the computer properly. For example, if a person wants to talk to another person, he must learn a language (like English, Hindi, Bangla, etc.), which another person can understand. If a human wants to talk to the computer or give some instructions, he has to learn a language which computers can understand. There are many languages that computers can understand, like python, java, and C++.

As we are going to learn C++ in this set of tutorials - here arises another essential question: why learn C++ despite it being an ancient programming language? Bjarne Stroustrup developed C++ as an addition to C language. The main reason to use C++ is that it is very close to the hardware, which means that it is beneficial for the programmer to give direct instructions to a device without using any intermediate medium. Another reason to use C++ is that it is an object-oriented programming language, and object-oriented languages can create complex real-world software systems. Well, we will dive very deep into OOPs and inheritance later in this course!

Installation of Visual Studio Code

Visual studio is a source code editor - free to use, provided & maintained by Microsoft. Below is the process of downloading and installing visual studio code:

Step 1: Go to Google and search "VS Code install" and click on the Visual studio link as shown in the image below            

Figure 1: Visual Studio Code Website

Step 2: Click on the user installer to download visual studio code according to the operating system in use.

Figure 2: Visual Studio Code Download Options

Step 3: After downloading open the program and click next to install the Visual studio code IDE.

Figure 3: Visual Studio Code Installation Step

Installation of g++

g++ is a compiler that helps us convert our source code into a .exe file. Below is the process of downloading and installing g++:

Step 1: Go to Google and search "MinGW install" and click on the MinGW link, as shown in the image below.

Figure 4: g++ installation from Google

Step 2: Click on the download button on the top right corner menu. 

Figure 5: G++ Download Step

Step 3: After visiting the download page, click on the windows button as shown in the image below to start the downloading

Figure 6 G++ Download Step

Step 4: After the download - open the program and click "Continue" to start the installation process.

Figure 7: G++ Installation Step

Step 5: After downloading some packages, it will show you a screen, as shown in the image below. You have to mark both the boxes as in the image below, and then click on installation on the top left corner menu. Finally, click apply changes, and it will start downloading the required packages.

Figure 8: G++ Installation Step

 

Step 6: After finishing step 5, close the program and open C:// drive. Furthermore, locate the MinGW folder. Go to its bin directory and copy its file path, as shown in the image below.

Figure 9: Copying g++ file path

 

Step 7: Now right-click on this pc and go to properties

Step 8: After that click on advanced system settings as shown in the image below

Figure 10: Step to Add g++ File Path

Step 9: After that click on "Environment Variables" as shown in the image below