Introduction to C++

C++ is a general purpose programming language that has a wide scope of implementations. It was developed by a Danish computer scientist Bjarne Stroustrup at Bell labs, New Jersey. Primarily used in software development, it is also widely used all the way in game development, application programming, compiler design and many more.

It is considered to be an intermediate level language because it has the features of both a high-level and a low-level language. C++ can be called as an advanced version of C programming language because it has all the properties of C with the additional concept of object oriented programming. C++ is often called as “C with classes”.

Although there are hundreds of different programming languages available, but C++ remains to be one the most popular programming languages in the software developers community.

There is an interesting fact about C++. In programming ‘++’ is the increment operator, which means incrementing a value by 1. C++ is created with the added feature of object oriented programming to the C language and hence the language got its name – C++.

Syntax of C++

#include<iostream> 
using namespace std; 
int main() 
{ 
    cout<<"This is a sample program"; 
    return 0; 
}

When this program executes, the following message would be printed.

This is a sample program

We will see the structure of a C++ program in details in the next lessons!

Features of C++

Rich Library : A lot of built-in functions are provided in the libraries (often called as header files) of C++ which saves time when building larger applications.

Compilation : Unlike interpreted languages, C++ is a compiled language. Its code needs to be compiled before execution.

Pointers : C++ supports the concept of pointers which are widely used in programming.

Speed : C++ is fast as compared to a bunch of other programming languages. Speed here means the time of both compilation and execution.

OOP : Object oriented programming is another important aspect of C++. Object oriented programming is one the programming paradigms which makes the maintenance and development comparatively easier.

Memory management : In C++, we can free the allocated memory at any instance of time as it supports the feature of  dynamic memory allocation.

Case sensitive : C++ is a case sensitive language. For example – in C++, the keyword ‘while’ and ‘WHILE’ are different.

Operator overloading : This is another important aspect of C++. One can redefine most of the built-in operators  to be used with the user defined data types as well.

Applications of C++

Operating systems – C++ is a strongly typed language, and this is the reason why most of the operating systems like Microsoft Windows, Mac OS, and LINUX are programmed in it.

DBMS – A DBMS (Database Management System) is a software which used to manipulate data in a database. Two of the most common DBMS, Postgres and MySQL are written in C++.MySQL is a widely used Database Management System widely used in most of the real world web applications.

Game development – C++ is widely used in the gaming industry. Various games have been developed by C++. It is mainly used to develop suites of game tools. There is a game engine called ‘Unity’ which is written in C++ and is used to create awesome two and three dimensional games.

Application Software – C++ is widely used in the applications involving GUI (Graphical User Interface). Some of the common examples are adobe photoshop, Adobe illustrator and adobe premiere.

Browsers – Most of the web browsers are programmed in C++ simply because of its speed. The rendering engine of a web browser needs faster execution so that the users don’t have to wait for the content to be loaded on the browser. Some of the browsers written in C++ are Google Chrome, Internet Explorer and Opera.

Compilers – C++ acts as the backend programming language for the compilers of various other programming languages.

Embedded systems – C++ is closer to the hardware level as compared to other programming languages, and this is why it is used as the primary programming language in making a variety of embedded systems.

Advantages of C++

  • C++ is a portable language, which allows the same program to run on multiple operating systems with ease.
  • It offers a wide range of applications like software development, games development, real-time mathematical simulations etc.
  • The job market of C++ is huge as it is used in various industries like software development, game development, system software etc.
  • C++ has a large community around the globe. There are above five million C++ developers worldwide as of 2020.
  • There are various community forums where experienced developers are ready to help you.
  • It supports multiple programming paradigms including generic, imperative and object oriented programming.