Preparation for the c++ review

Memory Management


new delete

shallow copy vs deep copy

constructor vs deconstructor

different types of constructor (default, parameterized, copy constructor)

why destructor matters

why need vitual destructor (pure virtual destructor)

reference vs pointers:

(can’t changed, not NULL, need to be initialised)

lvalue vs rvalue, rvalue reference with rvalue reference

(advanced topic, perfecting forward)

nullptr vs NULL (one type is pointer, another type is int and value is zero)

smart pointer in c++ (unique_ptr, shared_ptr, weak_ptr)

why need std::ref

storage class in C/C++:

auto, static, register(keyword:register), external (keyword:extern)

explain details about the automatic object (auto in c++ is different with original one)

iterator and smart pointers (for shared pointer what is overhead for it???)

OOP (object oriented programming)

key concepts about the OOP (abstraction, encapsulation, inheritance, polymorphism)

template defination

difference between class and struct

class access specifiers (public, private, protected)

what is diamond problem and how to solve it

Rule of Five(Write a copy constructor, move constructor, copy assignment operator, and move assignment operator)

when to use virtual function

pure virtual function and the abstract class

types of the inheritences(single, multiple, multilevel, hierachical, hybrid)

virtual table and virtual pointer

friend class and friend function

size of the empty class with the normal function and the virtual function

namespace and it’s using context

c++11 new features


rvalue reference


lamda expression (anonymous function)



future and promise



exceptions (different between throw and throw object)

#ifdef and #endif

translation unit

key word: volatile

details about the iterator in c++

useful resources