- Asked 2/10
- 2074 Chaitra · 2 marks
- 2070 Chaitra · 4 marks
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:
- Object oriented - supports classes, objects, encapsulation, inheritance and polymorphism.
- Superset of C - most C programs also compile in C++, and C libraries can be used.
- Data hiding and abstraction -
private,protectedandpublicaccess specifiers. - Function and operator overloading - one name for several related functions, and operators that work with user-defined types.
- Inline, default arguments and references - improve speed and convenience of function calls.
- Templates - generic functions and classes for any data type.
- Exception handling -
try,catchandthrowfor run-time errors. - Dynamic memory management -
newanddeleteoperators. - Standard Template Library (STL) - ready-made containers, iterators and algorithms.
- Namespaces and streams -
stdnamespace, and theiostreamclasses for input and output. - Portable and efficient - gives low-level control with high-level structure, so it is fast.
✓ Answer checked by Claude Opus 5.5 (high effort)