Skip to main content

Features of C++

Short answer

C++ supports object-oriented programming with classes, encapsulation, inheritance, polymorphism, and operator/function overloading. It adds templates, exception handling, references, inline functions, new/delete, STL, and namespaces, while retaining C efficiency and portability.

Explain the features of C++.

C++ was developed by Bjarne Stroustrup as an extension of C with object oriented features. Its main features are:

  1. Object oriented - supports classes, objects, encapsulation, inheritance and polymorphism.
  2. Superset of C - most C programs also compile in C++, and C libraries can be used.
  3. Data hiding and abstraction - private, protected and public access specifiers.
  4. Function and operator overloading - one name for several related functions, and operators that work with user-defined types.
  5. Inline, default arguments and references - improve speed and convenience of function calls.
  6. Templates - generic functions and classes for any data type.
  7. Exception handling - try, catch and throw for run-time errors.
  8. Dynamic memory management - new and delete operators.
  9. Standard Template Library (STL) - ready-made containers, iterators and algorithms.
  10. Namespaces and streams - std namespace, and the iostream classes for input and output.
  11. Portable and efficient - gives low-level control with high-level structure, so it is fast.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Object Oriented Programming chapter 2 questions →