The C++ language was designed and written by Bjarne Stroustrup who was working at AT&T Bell Labs, USA.
He began working on it in the year 1979, in order to enhance the features of C language.
Hence, it was initially called C with Classes but in year 1983, it was renamed to C++.
In the year 1985, the first edition of C++ language was officially released.
C++ is a powerful computer programming language which can be used to create different kind of applications, system programming and embedded
system software for different platforms.
The application which we can create in C++ language could be as simple, small as a video player and as a big, complex as an Operation System or a computer game.
C++ language provides many new and enhanced features than C language, such as -
virtual functions, operator overloading, improved type checking, classes, derived classes,
type-safe memory allocations, default arguments, improved type checking etc.
It is not just easy to code in C++ language but its programs are very fast to execute,
efficient and easily maintainable.
Let's us see some of the notable features of C++ language :
Main features of C++
Primitive data types
In C++, each variable has a specific data type,
where a data type tells us the size,
range and the type of a value that can be stored in a variable.
C provides us about seven data types known as primitive data types, which allow us to store and operate on all the possible kinds of values.
For more on data types in C++, you may read Primitive data types in C++ .
Control statements like if, if-else, switch, while loop, break, continue etc
control the flow of our program. To know more about control statements, starting
with if statement.
C++ introduced the concept of classes, where a class describes its behaviour through its functions,
where a function is a place where the logic of a class is stored.
A C++ class may have zero or more functions.
The C++ language gives us a powerful OOP feature known as inheritance. Inheritance allows a class to use/inherit the features of another existing class. For
more on inheritance, please read inheritance.
Operators in C++
C++ language provides different kinds of operators which allow us to easily perform simple to complex mathematical calculations using C++ language.
Operators such as -
arithmetic, increment, decrement, relational, logical etc. For more on operators, you can read our section
Operators in C++ .
One of the most important feature of C++ language is virtual function, which allows us to select
which overridden version of a function will be executed at runtime,
based on the type of object and not on the type of pointer variable declared to access the overridden function.
For more, please read our section Virtual Function in C++ .
In C++, a constructor is a special member function of class which is used to create and initialize its objects.
Contrary to the working of a constructor, a destructor is also a special member function
of a class, used to destroy the object of a class and to clean up its storage space, because this object is no longer accessible
which were created by the constructor.
read Destructor in C++ section.
C++ allows us to create and store a sequence of characters known as string. In
order create, store and print such sequence of character, C++ provides us many
library function. To know about String and its various important methods, please begin at
read C++ String section.
In C++, function Overloading is creating a function with the same name as an existing function in a class.
Hence in simple words, function overloading allows us to have multiple versions of a function within a class.
For more, please read function overloading.
C++ allows us to not only overload functions but also allows us to not just overload functions but also operators, such as unary and binary operators.