Allocating an array

int myarray[100]; int *myarray = new int[100];

Featureint myarray[100];*int myarray = new int[100];
Memory RegionStackHeap (Dynamic Store)
Allocation SpeedVery fast (just moves the stack pointer).Slower (requires finding free memory).
CleanupAutomatic (when scope ends).Manual (requires delete[]).
Size LimitLimited (Small stack size).Very Large (System RAM).
Variable SizeNo (Size must be constant).Yes (Size can be a variable).
SafetySafe from leaks, risky for overflows.Risky for leaks (if delete[] is forgotten).