Skip to content
academia.sh

Course Intermediate

C++ Fundamentals and Object Design

Published Updated

By the end of this course

Start course

01

Classes and Resources

Where C and C++ diverge, access control, constructors and destructors, RAII, deep and shallow copies, references and operator overloading — each paired with the question of which object an expression works with.

  1. 01 C and C++ Differences Introduces the course's four measurement kinds with a core run that measures which object a struct passed by value in C works with in C++.
  2. 02 Classes and Access Control Measures which object a member function works with, and that access control operates at the level of the class, not the object.
  3. 03 Constructors and Destructors Measures that an argument implicitly built from an int is an unnamed, temporary object, and measures its lifetime with a constructor/destructor pair.
  4. 04 RAII Measures that the member a guard acquires and releases is a part inside the guard object, not the guard itself.
  5. 05 Copying and Assignment Measures that the copy constructor and copy assignment operator produce a deep copy that takes its own array, and that the depth of the copy depends on the design of the class.
  6. 06 References Measures that a reference parameter works with the caller's own object, producing no copy at all.
  7. 07 Operator Overloading Measures why operator+ returns a new temporary object, and why operator+= instead returns its own object by reference.

02

Polymorphism and Structure

Inheritance and the base subobject, virtual functions and vtables, abstract classes, multiple inheritance and the diamond problem, exceptions, namespaces and type conversion operators — each paired with the question of which object an expression works with.

  1. 01 Inheritance The measurement of whether the base subobject a derived object carries inside it stands at the same address, and is part of a single construction/destruction sequence.
  2. 02 Virtual Functions and Vtables The measurement of whether a virtual call through a base pointer or reference always works with the same object, independent of the expression's static type.
  3. 03 Abstract Classes and Interfaces The measurement of how a pure virtual function guarantees that no instance can be constructed from the base class, and that an interface is a pure contract carrying no data.
  4. 04 Multiple Inheritance and the Diamond Problem The measurement of how the second base subobject in multiple inheritance does not share the same address as the derived object, and how a common ancestor in diamond-shaped inheritance doubles without virtual inheritance.
  5. 05 Exceptions The measurement of how many times a thrown object is copied while being caught, which parts a construction cut short by an exception destroy, and how a temporary object is copied fewer times than a named local.
  6. 06 Namespaces and Code Organization The measurement of how two symbols with the same name are separated by namespaces, and that a using declaration and a namespace alias are not a new symbol but an access path to an existing one.
  7. 07 Type Conversion Operators The measurement of whether static_cast, dynamic_cast, const_cast, and reinterpret_cast access a reference as a part of an existing object or as a copy in a new one, depending on the target type.

Final exam

C++ Fundamentals and Object Design — Final Exam

In preparation

This course's question bank is not complete yet. The exam opens here automatically once enough questions are added.

Start typing to search.

↑↓ ↵ Esc navigate · open · close