About C ++
Published: 2023-01-15 16:44:07

Developed in 1979, by computer scientist [Bjarne Stroustrup](https://www.stroustrup.com/), C++ is a high-level general-purpose programming language ( a language for building software in a wide variety of application domains), being an extension, or superset of the C programming language ( any C written code is valid C ++ code).

C++ was known as “C with Classes”,  and has the property of the C programming language along with the classes and objects, for user-defined data types. 

C++ is used everywhere, from building operating systems, to game development, compilers, cloud-distributed systems, and the list can go on. Being used by top tech giants such as Google, Meta, and Amazon, it has become with updates a high performance language, a popular one, and high in demand.

## What are the features of C ++ language?

**Supports Object-Oriented Programming(OOP)**:  
    
What does OOP means and how it is important?
    
As the name suggests, Object-Oriented Programming, it uses objects in programming. OOP aims to implement concepts of real-life entities like *inheritance, hiding, polymorphism,* etc in the realm of programming. Primary to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.
    
One of the concepts of OOP is classes, as mentioned above C++ supports *Classes*. But what are Classes?
    
Classes are *user-defined* data types. It can be viewed as a blueprint for creating objects (data structures), which can provide initial values for states (member variables or attributes), and implement behavior (member functions or methods).

![structure of a C++ class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9h2j8ce4dayfoqwic35.png)
- The class-name is the *name* assign to the class.
- The data is the *data* for the class, normally declared as variables.
- The functions are the *class functions*.


Example: 

![Exampple of a C++ class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxgwhn9ya948e8l69b5e.png)

**Compiler Based**: 
    
C++ is a compiled-base programming language, meaning C++ programs must be compiled, and their executable files are used to run, by this, it is faster than Java and Python.
    

**Dynamic Memory Allocation**:
    
Memory can be allocated dynamically, like during runtime. Programmers are not aware of how much memory would be required to store particular information in a defined variable, so we can define the size required at runtime.
    
**Fast and powerful**
    
C++ is a fast and powerful programming language that is suitable for a wide range of tasks due to its speed and advanced features. As a compiled language, C++ programs are efficiently translated into machine code, resulting in fast execution times. Additionally, C++ includes a variety of built-in functions and data types that allow programmers to easily implement complex algorithms and processes. These features make C++ a powerful and popular choice for many different types of projects.
    
**Build upon C**
    
C++ is a programming language that builds upon the foundations of C, inheriting many of its features. As a result, C++ includes the capabilities of C such as portability, a large standard library, structured programming, the use of pointers, and memory management. These features make C++ a versatile and widely used language.
    

**Similarities between C and C ++**:

- support the use of arrays, structures, and unions to group related data together.
- support the use of preprocessor directives, which are special commands that are processed by a preprocessor before the program is compiled.
- support the use of bitwise operators, which allow manipulation of individual bits within a value.
- support the use of the conditional operator (also known as the ternary operator), which is a compact way of expressing a simple if/else statement.
- support the use of the comma operator, which allows multiple expressions to be evaluated in a single statement.
- support the use of typecasting, which allows variables to be temporarily treated as if they were a different data type.
- support the use of the *sizeof* operator, which returns the size of a variable or data type in bytes.

While C and C++ have many similarities, C++ also includes additional features that are not found in C. These features include *object-oriented programming*, *exception handling*, and the ability to *overload operators*.

## Conclusion

C is a programming language that is primarily used for writing system software and low-level programming applications. It follows a procedural or structural approach, meaning that programs are written as a sequence of steps or procedures. C++ is an object-oriented programming language that builds upon the foundations of C. In addition to the features of C, C++ includes additional capabilities such as encapsulation, data hiding, data abstraction, inheritance, and polymorphism. These features help to make C++ well-suited for developing complex projects that require secure and flexible code.