Saturday, June 30, 2018

C++ Object Creation: Stack vs Heap

C++ Object Creation: Stack vs Heap

Create object in heap when:
    We explicitly want to control life cycle of object
    If the object is really big (Stack is of limited size: 1MB)