Introduction: C++ Tutorials Part-1
Hey guys! This is my first C++ tutorial.
In this tutorial we would cover -
● WHAT IS C++
● YOUR FIRST PROGRAMME IN C++
PLEASE SUPPORT ME BY LIKING IT.
Step 1: What Is C++
C++ is a mid-level programming language which was developed by Bjarne Stroustrup in 1979 in at&t bell laboratories.
This is a very simple to learn language if learnt with full interest in it. It is a very simple, yet powerful language.
This language can be used to create desktop applications, pc games, server applications, and many other performance-critical applications.
It is a mid-level OOP (object-oriented-programming) language and I will teach you about this.
Step 2: Materials Needed.
To make your first c++ programme you need the following-
●PROGRAMMING IDE - This is very much like a text editor, but a very modern and advance text editor. This ide is better than normal text editors like notepad as it has many features like - auto-completion, syntax highlighting (colouring of the code) etc. According to me I recommend you CODE BLOCKS ide.
●COMPILER - It is one of the main things required to build C++ programmes. A compiler basically converts the code in the form of text into the binary language which the computer can read and execute. The most popular and recomended compiler is GNU GCC compiler.
Step 3: Your First Hello World Programme.
To , make your first C++ programme
●STEP 1- Open your ide.
●STEP 2- Create a new project, a console application.
●STEP 3- Now write the above code in it.(in the image)
●STEP 3- Now save the code, build, compile and run it.
●STEP 5- When you will run the code a command prompt window will open and there would be the text 'hello world'. (you can later change the text)
Step 4: Understanding the Code
The meaning of the code -
■#include - This preprocessor directive tells the compiler to treat the contents of the code as if they appear in the source code at the point where the directive appears.
■ iostream - This library provides basic output and input functions.
■int main () - This line initiates a function, a funtion is a group of code statements which are given a name, in this case 'main'. I will tell about functions in the 'part 2'.
■cout<< - This is a basic C++ statement. It is functional and can produce some effect like output a piece of text. All statements end with a semicolon " ; ".
■return 0 ; - In this c++ programme the main funtion is of type 'int' and therefore we should return an integer value to it. This is considered the "exit status" of the application. IN SIMPLE LANGUAGE, IT TELLS THE OS THAT THE CODE RAN SUCCESSFULY WITH NO ERRORS.
Step 5: My Future Plans
My next part-2 will be based on -
● ADDING 2 NUMBERS PROGRAMME IN C++.