stack
: Stack stores the variables declared in the functions before the run-time.heap
: Heap is the free memory provided by the operating system to use during the run-time i.e in dynamic manner.new
to allocate memory dynamically. new
operator. If the requested memory is not granted, exception bad_alloc is occured.delete
which is applicable to single elements. If it is applied on arrays, delete removes only the first element in the memory.
Arrays can be removed using the delete[]
operator.