Before knowing about C++, we must know some basic computer knowledge but if you are not a newbie and just looking for some brief facts and definitions, you can skip this part.
So, A computer is a device that can perform a multi-computational task but since it’s a machine, it cannot do anything on its own.
To get any job done, we need to give instructions to the computer according to which it will work.
The instructions we give to the computer is called a program.
The person giving the instructions is called a programmer and the language programmers to give instructions is called programming language. So, programmers can use any language available to do programming. C++ is one such programming language.
History Of C++ And C:
C++ is developed by Bjarne Stroustrup in 1979 at AT&T’s Bell Labs. When it is was developed, it was called C with classes.
The purpose behind its development was although C was famous and widely used it had its own limitations. C++ was developed with OOPs feature which was influenced by a language that existed at that time called Simula 67.
In 1983, the name was changed to C++. Interestingly, the’++’ is an operator in the C language which is used for increment. Since C++ was an increment of C, it was named so.
What is C++:
C++ is an object-oriented programming language(OOP). C++ being well structured and Oops based it is a lot safer than C.
C++ is procedural, generic, modular, functional and object-oriented. These features make C++ very powerful and efficient.
This is the reason why despite being old C++ is still widely used and is present in deep roots of the technical and online world.
Features of C++:
It supports features of C as well as some of its own features listed below:
- Array
- Structure
- Class
- Object
- Constructor
- Destructor
- Inheritance
- Polymorphism
- Encapsulation
- Namespaces
- Pointers
It has many more features which are not listed here.
Uses of C++:
C++ being fast, reliable, efficient and user-friendly used in different fields like:
- Games
- Graphics designing
- OS building
- Applications and web frameworks like Microsoft .NET
- Browsers
- Libraries
- Cloud systems
- Compilers
How is C++ different from C:
Despite being an advanced version of C, C++ is very different from C.
The basic and common differences are:
- C doesn’t support features like polymorphism, encapsulation and inheritance like C++. This is the reason it’s not Object-oriented.
- In C, data and functions are separated as it is a procedural programming language while C++ encapsulates data and functions.
- C has 32 keywords while in addition to these keywords C++ has extra 31 keywords totalling 63.
- C doesn’t support function and operator overloading while C++ does.
- Namespace feature is used in C++ but not in C.
- Data can’t be hidden in C, while in C++ it can be done by encapsulation to ensure the right use of data.
- C and C++ have different header files, stdio.h and iostream respectively.]
- Virtual and friend functions are supported by C++ but not by C.
- Exceptional handling is not directly supported by C but it is supported in C++.
- C and C++ use different functions for different tasks like malloc() and calloc() in C and new operator in C++, like printf and scanf in C and cin and cout in C++.
- C doesn’t have access modifiers while C++ does.
Please write comments or WhatsApp if you find anything incorrect, or you want to share more information about the topic discussed above.