All Courses
OOP: INTRODUCTION

Features of C++

C++ is popular because it gives both high-level design tools and low-level control.

For OOP, the most important features are below.

1. Multi-Paradigm

C++ supports several programming styles:

  • procedural programming with functions
  • object-oriented programming with classes
  • generic programming with templates
  • functional-style programming with lambdas and algorithms

This matters because good C++ code does not force OOP everywhere. It uses OOP when objects make the problem clearer.

2. Compiled and Efficient

C++ is compiled into machine code before it runs.

This usually gives strong performance, especially in systems where speed and memory control matter.

Examples:

  • game engines
  • embedded systems
  • operating-system components
  • high-performance tools

3. Classes and Objects

C++ lets you define your own types using classes.

Classes support:

  • data members
  • member functions
  • constructors
  • destructors
  • access control
  • inheritance
  • polymorphism

These are the core tools for OOP.

4. Direct Memory Control

C++ gives direct control over object lifetime and memory.

You can create objects:

  • automatically on the stack
  • dynamically on the heap
  • inside other objects
  • inside standard containers

Modern C++ usually prefers RAII, containers, and smart pointers instead of manual new and delete.

5. Standard Library

C++ has a powerful standard library.

Important tools for OOP learners:

  • std::string
  • std::vector
  • std::map
  • std::unique_ptr
  • std::shared_ptr
  • algorithms such as sort and find

These tools help you write safer classes.

6. Strong Type System

C++ checks types carefully at compile time.

Example:

int age = 20;
// age = "twenty"; // error

This helps catch mistakes before the program runs.

Viva Answer

C++ is a compiled, strongly typed, multi-paradigm language. It supports procedural, object-oriented, generic, and functional-style programming. Its OOP features include classes, objects, constructors, destructors, access specifiers, inheritance, and polymorphism.

Quick Check

  • Why is C++ called multi-paradigm?
  • Why does C++ need constructors and destructors?
  • What is the safer modern alternative to raw new/delete?
  • Name three standard library tools useful in OOP.