Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
C++ is an object oriented computer language created by notable computer scientist Bjorne Stroustrop as part of the evolution of the C family of languages.
Some call C++ “C with classes” because it introduces object oriented programming principles, including the use of defined classes, to the C programming language framework.
C++ is pronounced "see-plus-plus."
When C++ was new, object oriented programming was just coming on the scene. This revolutionary type of computer programming transformed the coding world with its promise of more sophisticated virtual data types and objects.
In object oriented programming, an object is a data type that has both data and functions inherent in its design. Prior to the advent of object oriented programming, programmers typically saw a codebase as composed of individual command line instructions. The identification of objects with data and functions built in led to a new way of packaging and automating code work.
For an excellent example of object oriented programming in C++, one of the most notable and useful features of the language was the C++ stack.
The C++ stack is a class in C++ that has the following characteristics – it is a virtual last in first out sequential storage container that has a defined set of elements. The functions ‘push’ and ‘pop’ either push a new item into the bottom of the stack or pop the first available item from the top of the stack.
Programmers have utilized the C++ stack in many different ways to achieve goals involving variable evaluation and functional operations within a codebase.
The language also applies principles of encapsulation, which identifies usage models, and inheritance, where one class can inherit certain attributes or properties from another.
Another way to look at C++ in a practical sense is to start enumerating different kinds of errors that occur as the written code makes its way to final execution.
First, there are syntax errors where the code is actually written in an illegible way. This can be a misuse of punctuation, or the misspelling of a function command or anything else that compromises the integrity of the syntax as it is written.
Another fundamental type of error is a compiler error that simply tells the programmer the compiler was not able to do its work effectively. As a compiler language, C++ relies on the compiler to make the source code into machine readable code and optimize it in various ways.
A third type of error happens after the program has been successfully compiled. Runtime errors are not uncommon in C++ executables. What they represent is some lack of designated resource or non-working command in the executable program.
In other words, the syntax is right, and the program was compiled successfully, but as the program is doing its work, it encounters a problem, whether that has to do with interdependencies, operating system requirements or anything else in the general environment in which the program is trying to work.
Over time, C++ has remained a very useful language not only in computer programming itself, but in teaching new programmers about how object oriented programming works.