Features of C++3 min read

C++ is an Object-Oriented Programming Language, which is its main feature. It can create and destroy objects while programming. As it is an enhancement to C, hence it possesses all the features offered by C along with its new important feature (Object-Oriented Programming, operator overloading, error handling, etc).

What are the Features of C++ programming Language?

  1. Object-Oriented Programming (OOP)
  2. Simple
  3. Platform or Machine Dependent/Portable
  4. High-Level Language
  5. Multi-paradigm programming language
  6. Case Sensitive
  7. Compiler based
  8. Speed
  9. Rich in Library
  10. Memory Management
  11. Pointer and Recursion

1. Object-Oriented Programming (OOP)

C++ is an Object-Oriented Programming Language and it is its main feature. It provides a modular structure for programs that means OOP divides the program into a number of objects and makes it simpler and easier for maintainance which is not provided in Procedure-oriented programming language such as C. Therefore understanding OOP is an important step to learn Java Programming.

C++ follows four main concepts of OOP those are abstraction, data encapsulation, data hiding, and polymorphism.

2. Simple

It is a simple programming language in the sense of a structured approach that is the program can be broken down into parts and can be resolved modularly. This helps the programmer to recognize and understand the problem easily.

3. Platform or Machine Independent/Portable

Platform Dependent language refers to those languages that are executed only on that operating system where it is developed but cannot be executed on any other Operating system. And C++ is of those languages.

Although portability refers to using the same piece of code on various environment with little or no change.

4. High-Level Language

C++ is a high Level language, making it easier to understand as it is closely associated with the human-comprehensible language that is English.

It also supports the feature of low-level language that is used to develop system applications such as kernel, driver, etc. That is why it is also known as mid-level language as C++ has the ability to do both low-level & high-level programming.

5. Multi-paradigm programming language

C++ is a language that supports object-oriented, procedural and generic programming. It supports at least 7 different styles of programming. This makes it very versatile.

6. Case Sensitive

Similar to C, C++ also treats the lowercase and uppercase characters in a different manner. For example, the keyword “cout’ (for printing) changes if we write it as ‘Cout’ or “COUT”. But this problem does not occur in other languages such as HTML and MySQL.

7. Compiler-based

C++ is a compiler-based programming language, unlike Java or Python which are interpreter-based. This feature makes C++ comparatively faster than Java or Python language.

8. Speed

It is a compile-based, hence the compilation and execution time of C++ language is fast.

9. Rich in Library

C++ offers a library full of various in-built function that makes the development with C++ much easier and faster. These functions are present in the various header files and header files are included at the beginning of the program depending on which function the programmer needed to use.

Some of the header files used in C++:

<iostream>Contains C++ standard input and output functions
<cmath>Contains math library functions
<ctime>Contains function for manipulating the time and date
<fstream>Contains function for functions that perform input from files on disk and output to files on disk

10. Memory Management

C++ has this feature that allows us to allocate the memory of a variable in run-time. This is known as Dynamic Memory Allocation. There is a function called free() that allows us to free the allocated memory.

11. Pointer and Recursion

Unlike Java, C++ supports pointers for direct interaction with the memory. Pointer is used for memory, structures, functions, array etc. It provides various solution for the memory related problems in a program.

It provides code reusability for every function that is the recursion.


MORE

Java Program to find the sum of the Largest Forward Diagonal

in this tutorial, we will write a java program to find the sum of the Largest Forward Diagonal in an Arraylist (matrix). Java Program to …

C Program to search an element in an array using Pointers

A separate function( search_function()) will be created where the array pointer will be declared and the searched element along with the size of an array …

C Program to find the sum of the digits of a number using recursion function

This C program calculates the sum of digits of a given number using recursion. Here’s a concise explanation: Function Definition: sumDigits(int n) This function calculates …

C program to find factorial of a number using Ternary operator with Recursion

Recursion refers to the function calling itself directly or in a cycle. Before we begin, you should have the knowledge of following in C Programming: …

C Program to Add Two Numbers Using Call by Reference

The program takes the two numbers from the user and passes the reference to the function where the sum is calculated. You may go through …

Find the output ab, cd, ef, g for the input a,b,c,d,e,f,g in Javascript and Python

In this tutorial, we will write a program to find a pairs of elements from an array such that for the input [a,b,c,d,e,f,g] we will …