Classes and Inheritance

Pointers and Memory

What’s that keyword?

The STL

C++ Concepts

100

In a base -> derived chain, which constructor is called first?

Base constructor

100

To pass something by reference, what character do you use?

Ampersand/And symbol (&)

100

What keyword, used along with “new,” frees allocated memory?

delete

100

What type of container has a dynamic size, and can thus contain any number of elements?

Vector

100

Meaning “many forms,” what concept describes how functions and operators can have multiple definitions via overloading?

Polymorphism

200

What does it mean if a function is “pure virtual” compared to just “virtual?”

The function MUST be inherited in a derived class

200

What is the difference between the heap and the stack?

Stack is fixed memory, heap is shared memory

200

What keyword creates a block of code that only runs if it’s thrown an error?

catch

200

What type of object is commonly used with a for loop to increment through a container of objects?

Iterator

200

Objects that store other objects, like vectors or arrays, are called what?

Containers/Data stores

300

During protected inheritance, what happens to the base class’s public members?

They become protected

300

A pointer that points to deallocated memory is called a what?

Dangling pointer

300

What keyword allows a function to access the private members of a class without being a member of it?

friend

300

What type of container allows insertion and deletion at both ends?

(Hint: Its name is short for “double-ended queue”) 

Deque

300

The idea of a class containing all its data so it can be treated as a single object is called what?

Encapsulation

400

What type of inheritance allows a class to inherit from more than one class?

Multiple inheritance

400

In the line “int* const ptr = 5”, what part of the variable becomes unchangeable?

The address

400

What keyword suggests the compiler make a copy of a function’s body wherever the function is called?

inline

400

What type of object is used to to perform operations on containers like sorting, searching, and swapping elements?

Algorithms

400

What concept describes using templates to give a function or class different behaviors when passed different data types?

Template specialization

500

What type of error occurs when the compiler can’t choose between two overloaded functions?

Ambiguity error

500

What operator is used in place of a dot operator to dereference the pointer it’s calling from?

Arrow operator (->)

500

What keyword makes a class unable to be inherited from?

final

500

Hey… what does “STL” stand for, anyways?

Standard Template Library

500

When a derived class is assigned to a base class, the derived class’s extra attributes are cut off. What is this process called?

Slicing

M
e
n
u