FAQ Part 13: Miscellaneous Concepts

What are namespaces?

Namespaces prevent name conflicts.

namespace mycode {
    int x = 5;
}

What is operator overloading?

Redefining operators for user-defined types.

Complex operator+(Complex a, Complex b);

What is the difference between shallow and deep copy?

  • Shallow copy: Copies pointer addresses
  • Deep copy: Copies actual data