Skip to content
AtomicReps

Navigation

15/30Computer Science

C++ Programming.

The C++ language: references, classes, virtual dispatch, lambdas and casts.

  • C++ Programming · 1 of 3

    Range-based for & Initialization

    In C++, what value does int z{}; give z?

  • C++ Programming · 2 of 3

    Lambdas & Captures

    A closure that captured a local by reference is returned and then called. What does this program do?

    typescript
    #include <iostream>#include <functional>std::function<int()> make() { int local = 7; return [&local]() { return local; }; }int main() {  auto f = make();  std::cout << f();}
  • C++ Programming · 3 of 3

    Inheritance & Virtual Functions

    A developer copies a Circle into a cache slot of type Shape, a polymorphic class that Circle inherits from, then calls dynamic_cast<Circle*> on the slot's address. The cast always yields nullptr. Why?

Three of the 1,756 C++ Programming questions.

Keep going with C++ Programming, free
Next topic · 16/30C++ Standard Library.