Course Content
  • 1. Introduction to C++, Installing VS Code, g++ & more | C++ Tutorials for Beginners #1
    Free YouTube Video
  • 2. Basic Structure of a C++ Program | C++ Tutorials for Beginners #2
    Free YouTube Video
  • 3. Variables & Comments in C++ in Hindi | C++ Tutorials for Beginners #3
    Free YouTube Video
  • 4. Variable Scope & Data Types in C++ in Hindi | C++ Tutorials for Beginners #4
    Free YouTube Video
  • 5. C++ Basic Input/Output & More | C++ Tutorials for Beginners #5
    Free YouTube Video
  • 6. C++ Header files & Operators | C++ Tutorials for Beginners #6
    Free YouTube Video
  • 7. C++ Reference Variables & Typecasting | C++ Tutorials for Beginners #7
    Free YouTube Video
  • 8. Constants, Manipulators & Operator Precedence | C++ Tutorials for Beginners #8
    Free YouTube Video
  • 9. C++ Control Structures, If Else and Switch-Case Statement | C++ Tutorials for Beginners #9
    Free YouTube Video
  • 10. For, While and do-while loops in C++ | C++ Tutorials for Beginners #10
    Free YouTube Video
  • 11. Break and Continue Statements in C++ | C++ Tutorials for Beginners #11
    Free YouTube Video
  • 12. Pointers in C++ | C++ Tutorials for Beginners #12
    Free YouTube Video
  • 13. Arrays & Pointers Arithmetic in C++ | C++ Tutorials for Beginners #13
    Free YouTube Video
  • 14. Structures, Unions & Enums in C++ | C++ Tutorials for Beginners #14
    Free YouTube Video
  • 15. Functions & Function Prototypes in C++ | C++ Tutorials for Beginners #15
    Free YouTube Video
  • 16. Call by Value & Call by Reference in C++ | C++ Tutorials for Beginners #16
    Free YouTube Video
  • 17. Inline Functions, Default Arguments & Constant Arguments in C++ | C++ Tutorials for Beginners #17
    Free YouTube Video
  • 18. Recursions & Recursive Functions in C++ | C++ Tutorials for Beginners #18
    Free YouTube Video
  • 19. Function Overloading with Examples in C++ | C++ Tutorials for Beginners #19
    Free YouTube Video
  • 20. Object Oriented Programming in C++ | C++ Tutorials for Beginners #20
    Free YouTube Video
  • 21. Classes, Public and Private access modifiers in C++ | C++ Tutorials for Beginners #21
    Free YouTube Video
  • 22. OOPs Recap & Nesting of Member Functions in C++ | C++ Tutorials for Beginners #22
    Free YouTube Video
  • 23. C++ Objects Memory Allocation & using Arrays in Classes | C++ Tutorials for Beginners #23
    Free YouTube Video
  • 24. Static Data Members & Methods in C++ OOPS | C++ Tutorials for Beginners #24
    Free YouTube Video
  • 25. Array of Objects & Passing Objects as Function Arguments in C++ | C++ Tutorials for Beginners #25
    Free YouTube Video
  • 26. Friend Functions in C++ | C++ Tutorials for Beginners #26
    Free YouTube Video
  • 27. Friend Classes & Member Friend Functions in C++ | C++ Tutorials for Beginners #27
    Free YouTube Video
  • 28. More on C++ Friend Functions (Examples & Explanation) | C++ Tutorials for Beginners #28
    Free YouTube Video
  • 29. Constructors In C++ | C++ Tutorials for Beginners #29
    Free YouTube Video
  • 30. Parameterized and Default Constructors In C++ | C++ Tutorials for Beginners #30
    Free YouTube Video
  • 31. Constructor Overloading In C++ | C++ Tutorials for Beginners #31
    Free YouTube Video
  • 32. Constructors With Default Arguments In C++ | C++ Tutorials for Beginners #32
    Free YouTube Video
  • 33. Dynamic Initialization of Objects Using Constructors | C++ Tutorials for Beginners #33
    Free YouTube Video
  • 34. Copy Constructor in C++ | C++ Tutorials for Beginners #34
    Free YouTube Video
  • 35. Destructor in C++ in Hindi | C++ Tutorials for Beginners #35
    Free YouTube Video
  • 36. Inheritance & Its Different Types with Examples in C++ | C++ Tutorials for Beginners #36
    Free YouTube Video
  • 37. Inheritance Syntax & Visibility Mode in C++ | C++ Tutorials for Beginners #37
    Free YouTube Video
  • 38. Single Inheritance Deep Dive: Examples + Code | C++ Tutorials for Beginners #38
    Free YouTube Video
  • 39. Protected Access Modifier in C++ | C++ Tutorials for Beginners #39
    Free YouTube Video
  • 40. Multilevel Inheritance Deep Dive with Code Example in C++ | C++ Tutorials for Beginners #40
    Free YouTube Video
  • 41. Multiple Inheritance Deep Dive with Code Example in C++ | C++ Tutorials for Beginners #41
    Free YouTube Video
  • 42. Exercise on C++ Inheritance | C++ Tutorials for Beginners #42
    Free YouTube Video
  • 43. Ambiguity Resolution in Inheritance in C++ | C++ Tutorials for Beginners #43
    Free YouTube Video
  • 44. Virtual Base Class in C++ | C++ Tutorials for Beginners #44
    Free YouTube Video
  • 45. Code Example Demonstrating Virtual Base Class in C++ | C++ Tutorials for Beginners #45
    Free YouTube Video
  • 46. Constructors in Derived Class in C++ | C++ Tutorials for Beginners #46
    Free YouTube Video
  • 47. Solution to Exercise on Cpp Inheritance | C++ Tutorials for Beginners #47
    Free YouTube Video
  • 48. Code Example: Constructors in Derived Class in Cpp | C++ Tutorials for Beginners #48
    Free YouTube Video
  • 49. Initialization list in Constructors in Cpp | C++ Tutorials for Beginners #49
    Free YouTube Video
  • 50. Revisiting Pointers: new and delete Keywords in CPP | C++ Tutorials for Beginners #50
    Free YouTube Video
  • 51. Pointers to Objects and Arrow Operator in CPP | C++ Tutorials for Beginners #51
    Free YouTube Video
  • 52. Array of Objects Using Pointers in C++ | C++ Tutorials for Beginners #52
    Free YouTube Video
  • 53. this Pointer in C++ | C++ Tutorials for Beginners #53
    Free YouTube Video
  • 54. Polymorphism in C++ | C++ Tutorials for Beginners #54
    Free YouTube Video
  • 55. Pointers to Derived Classes in C++ | C++ Tutorials for Beginners #55
    Free YouTube Video
  • 56. Virtual Functions in C++ | C++ Tutorials for Beginners #56
    Free YouTube Video
  • 57. Virtual Functions Example + Creation Rules in C++ | C++ Tutorials for Beginners #57
    Free YouTube Video
  • 58. Abstract Base Class & Pure Virtual Functions in C++ | C++ Tutorials for Beginners #58
    Free YouTube Video
  • 59. File I/O in C++: Working with Files | C++ Tutorials for Beginners #59
    Free YouTube Video
  • 60. File I/O in C++: Reading and Writing Files | C++ Tutorials for Beginners #60
    Free YouTube Video
  • 61. File I/O in C++: Read/Write in the Same Program & Closing Files | C++ Tutorials for Beginners #61
    Free YouTube Video
  • 62. File I/O in C++: open() and eof() functions | C++ Tutorials for Beginners #62
    Free YouTube Video
  • 63. C++ Templates: Must for Competitive Programming | C++ Tutorials for Beginners #63
    Free YouTube Video
  • 64. Writing our First C++ Template in VS Code | C++ Tutorials for Beginners #64
    Free YouTube Video
  • 65. C++ Templates: Templates with Multiple Parameters | C++ Tutorials for Beginners #65
    Free YouTube Video
  • 66. C++ Templates: Class Templates with Default Parameters | C++ Tutorials for Beginners #66
    Free YouTube Video
  • 67. C++ Function Templates & Function Templates with Parameters | C++ Tutorials for Beginners #67
    Free YouTube Video
  • 68. Member Function Templates & Overloading Template Functions in C++ | C++ Tutorials for Beginners #68
    Free YouTube Video
  • 69. The C++ Standard Template Library (STL) | C++ Tutorials for Beginners #69
    Free YouTube Video
  • 70. Containers in C++ STL | C++ Tutorials for Beginners #70
    Free YouTube Video
  • 71. Vector In C++ STL | C++ Tutorials for Beginners #71
    Free YouTube Video
  • 72. List In C++ STL | C++ Tutorials for Beginners #72
    Free YouTube Video
  • 73. Map In C++ STL | C++ Tutorials for Beginners #73
    Free YouTube Video
  • 74. Function Objects (Functors) In C++ STL | C++ Tutorials for Beginners #74
    Free YouTube Video

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

In these C++ tutorials, we are going to learn about the C++ programming language from the very basics to the industry level. This course has been designed in a way to nurture the beginners setting their feet in this discipline. So tighten your belts, and enjoy the ride!

Before starting, let me explain to you the difference between this and any other source for learning C++:

  1.     This is a whole complete package in itself, covering from A to Z of the language.
  2.     No redundancy and monotonicity.
  3.     Beginner friendly, hence easy to learn.
  4.     No prerequisite, just a zeal for learning.

To start with, I’ll be covering these things in today’s 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, programming language, and why C++?

Programming can be understood as your instructions to the computer(machine) to solve real problems. The very basic principle of creating machines was to make life simpler and machines, on our instructions, have been able to do the same. But the distance between what we say and what the machine understands gets abridged by a programming language. This marks the importance of learning a programming language.

A programming language helps us communicate with the computer. Analogous to us humans, who need some language, be it English, Hindi, or Bangla, to talk to our people, computers too need a language to converse.  Just to name a few, there is C++, C, Python, Java, etc.

Now when we start listing the names of these programming languages, the question which instinctively arises is why C++. Despite this being an 80s programming language, it never lost its sheen. C++ was an added version of C developed by Bjarne Stroustrup. It is believed to be very close to the hardware making it comparatively easy for programmers to give the instructions directly to the system without any intermediary. Another reason for C++ to be one of the most used languages is its object-orientedness. C++  is an object-oriented programming language giving it the power to create real-world software systems. You don’t have to worry much about these terms, which believe me, only sound complex and ain’t really! Just sit back and dive with me in this plethora of knowledge.

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: Click here and you will be redirected to the official download page of VS Code. Download the VS code according to your operating system in use. I will be downloading it for Windows 10 as shown in the below animation.           

Figure 1: Visual Studio Code Website

Step 2: Once the downloading is complete, install VS code on your system like any other application.

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

Figure 11: Step to Add G++ File Path

Step 10: After that select path and click on edit as shown in the image below

Figure 12: Step to Add g++ file path

 

Step 11: Then, click on new and paste the file path and click ok as shown in the image below

Figure 13: Adding g++ File Path

After adding the file path now, our g++ compiler is ready, and we can start coding now.

Writing Our First Program and Executing It

To write our first program, we need Visual studio code, which is a source code editor. Create a folder and then right-click inside the folder and click on "open with code" as shown below:

Figure 14: Opening Visual Studio Code in a folder

Following these steps will open your visual studio code with that folder as the context. After opening the VS Code, you have to install some extensions. Go to the extension menu and search "C/C++," and it will show you this extension. C/C++, as well as the other extensions we add, will make our life easy while learning C++. Click on the install button, and it will start installing the extension for you, as shown in the image below.

Figure 15: Installing Extension

This extension will help us in writing code through features such as auto-complete or auto-dropdown suggestions. Let us install one more extension, which will help us run our programs quickly. Go to the Extensions tab in the top left corner and search "Code runner." After that, click on install.

Figure 16: Installing Extension

Now we have to create our program file and start writing our code. To create a program file, you have to go to the File menu > then click on the file button, as shown in the image below.

Figure 17: Creating a Program File

 After clicking on the file button, it will ask you for the file name. Give the name of the file as "tutorial1.cpp" and press enter. Now the code file will be created, and you can start writing your program.

Figure 18: Running Code

In today's tutorial, we are not going to learn anything about what this code is all about. We will learn these things step by step in our upcoming lectures. Now to execute this code, press the run button, as shown in the image above, and it will give you the output as shown in the image below.

Figure 19: Program Output

Thank you friends for starting to learn C++ with me, hope you liked the tutorial. If you haven’t checked out the whole playlist yet, move on to codewithharry.com or my YouTube channel to access it. I hope you enjoy them.

In the next tutorial, we’ll be talking more about the basic structures of a C++ program, see you there, till then keep coding.

Code as described/written in the video

#include<iostream>

int main(){
    std::cout<<"Hello World";
    return 0;
}

You need to be logged in to post a comment!

Comments

Sudipto21 Jun 14, 2021
I cann't download mingw . Please help me how to download this.
Sudipto21 Jun 14, 2021
I cann't download mingw. please help me how to download this.
superbanno999 May 31, 2021
mera code likhne se aisa dikha raha hai .\tut1.cpp:4:16: warning: character constant too long for its type std::cout<<'Hello World'; ^~~~~~~~~~~~~ kya matlab hai iska?
Show 1 replies
ayush03 Apr 12, 2021
harry bhai, kya aap linux me vs code working ka ek video upload skte ho kya? ..usme extensions or sources ko explain kr doge pls...
pranjay31 Apr 7, 2021
Ankit Pranjay Bihar

Resources

No resource files associated with this project

Course Announcements

Any Course related announcements will be posted here