C++ Programming Language Features

C++Object Oriented ProgrammingProgramming

C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. It is a superset of C, and that virtually any legal C program is a legal C++ program. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. Following are some of the features of C++ that make it stand out among other programming languages −

  • Multi-paradigm language − C++ is a language that supports procedural, object-oriented and generic programming. This makes it very versatile.
  • Use of pointers and references − C++ supports pointers and references that allow the user to deal directly with the memory and gives all the control to the programmer. This makes it very suitable for low-level tasks and very complex projects.
  • Statically Typed  − A language is statically typed if the type of a variable is known at compile time. For some languages, this means that you as the programmer must specify what type each variable is. The main advantage here is that all kinds of checking can be done by the compiler, and therefore a lot of trivial bugs are caught at a very early stage.
  • C++ allows you to specify more than one definition for an operator for different types(objects?) which is called operator overloading. This allows users to treat even very complex types as built-in types.
  • An interface describes the behavior or capabilities of a C++ class without committing to a particular implementation of that class. The C++ interfaces are implemented using abstract classes and these abstract classes should not be confused with data abstraction which is a concept of keeping implementation details separate from associated data.
  • Multiple Inheritance is a feature of C++ where a class can inherit from more than one classes. The constructors of inherited classes are called in the same order in which they are inherited. The destructors are called in reverse order of constructors. Multiple inheritances allow the object to be of multiple types and hence makes real-world modeling in the program very easy.
  • Using ternary operators as lvalues
  • The auto keyword that does type deduction automatically without needing the programmer to interfere.

There are many more features supported by the C++ language. Building an exhaustive list of such features is not possible. Take a look at the docs to discover more such features on your own!

raja
Published on 15-Feb-2018 11:39:05
Advertisements