C++ Introduction

Bjarne Stroustrup came up with the idea of creating a powerful language that combines Simula67 and C. As a result, at AT&T Bell Laboratories developed C++ that supports object-oriented features, with the power of both languages. Therefore, C++ was also initially known as “C with Classes”, since classes were added, also considering it as an extension of C.

Finally, the name C++ was finalized in 1983, considering it as an increment of C language.

Features of C++

Here are the features of C++,

Polymorphism

It is a Greek term that means Poly + morphism i.e. more than one form. It can also be said as different behaviors in different instances. Polymorphism can be seen and used in the following,

  • Operator Overloading:
    When an operator performs different types of tasks it is known as operator overloading. It performs different behaviors in different instances.
  • Function Overloading:
    When a function performs different types of tasks.

Classes

Class is a blueprint, which contains data member and member functions. A class can have any number of objects and therefore a class can be considered as a collection of objects that belong to the same class.

Objects

An Object in C++ is a runtime entity. They have an associated memory and take space in memory. For example, if Clothing is a class, then Tshirt can be an object defined as, clothing tshirt;

Encapsulation

When you enclose data and functions into a single unit, it is known as Encapsulation. The unit in which the data and functions are enclosed is known as a class.

Abstraction

When key features are represented without including the background details is known as Abstraction. Classes use it and the attributes are known as data members. Functions in a class are known as member functions. Classes are also known as Abstract Data Types (ADT), since it use the concept of data abstraction with data members and member functions.

Inheritance

Inheritance brings reusability and supports hierarchical classification.  For example, Tshirt class is a part of the Clothing. Inheritance has a base class and a derived class. Common characteristics are shared by the derived class with the base class (i.e. the class from which it is derived).

Applications of C++

The following are the real-life applications of C++:

  • The MySQL database was written in C++.
  • One of the most popular web browsers, such as Mozilla Firefox is written in C++
  • Many Python libraries for Data Science and Machine Learning are written in C++, such as OpenCV, TensorFlow, and SciPy.
  • MongoDB, a NoSQL database is written in a lot of programming languages, one of them being C++.
  • The Operating Systems, Windows and Mac are written in C and C++.
  • Games are also developed in C++.

Recommended Posts


If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


C++ Cheat Sheet
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading