What Is C++ language?

0 8

Get real time updates directly on you device, subscribe now.

Introduction of C++ Language

C++ is a general-purpose object-oriented programming (OOP) language, developed by Bjarne Stroustrup, and is an extension of the C language. Initially, the language was called “C with classes” as it had all the properties of the C language with an additional concept of “classes.” However, it was renamed C++ in 1983.

C++ is a general-purpose programming language.
C++ is used to create computer programs. Anything from art applications, music players and even video games!

Your First C++ Program

A C++ program is a collection of commands or statements. Below is a simple code that has “Hello world!” as its output.

#include <iostream>
using namespace std;
int main()
{
cout << “Hello world!”;
return 0;
}

Let’s break down the parts of the code.

#include
<iostream>
C++ offers various headers, each of which contains information needed for programs to work properly. This particular program calls for the header.
<iostream><iostream><iostrea

The number sign (#) at the beginning of a line targets the compiler’s pre-processor. In this case, #include tells the pre-processor to include the <iostream> header.
The <iostream> <iostream> header defines the standard stream objects that input and output data.

The C++ compiler ignores blank lines.

In general, blank lines serve to improve the code’s readability and structure.
Whitespace, such as spaces, tabs, and newlines, is also ignored, although it is used to enhance the program’s visual attractiveness.

#include <iostream>
using namespace std;

int main()
{
cout << “Hello world!”;
return 0;
}

In our code, the line using namespace std; tells the compiler to use the std (standard) namespace.
The std namespace includes features of the C++ Standard Library.

Leave A Reply

Your email address will not be published.