solulubeta
Sign in
CS Theory / Object-Oriented Programming
04.06 · Lesson

Namespaces & Access Control

A logical division of code designed to stop naming conflicts and define scope for identifiers.

3 min Free

Namespaces

A logical division of code designed to stop naming conflicts and define scope for identifiers.

  • Removes ambiguity when different tasks occur with same name.
  • Standard namespace ‘std’ contains inbuilt classes and functions.

Access Specifiers

Define how functions and variables can be accessed outside the class:

  • Private: Accessible only within the same class.
  • Public: Accessible from anywhere.
  • Protected: Accessible within class and child classes (generally used in inheritance).

Additional OOP Notes

Key technical details in C++ OOP:

  • Delete: Used to release a unit of memory; delete[] for an array.
  • Virtual inheritance: Facilitates creating only one copy of each object if it appears more than once in hierarchy.
  • Operator overloading: Standard operators can be redefined for class instances.
Mark this as done when you are finished.

Item 28 of 28 · updated 2026-10-12