what r the reason , complier assign dynamic memory in heap
Use Of new and delete Operator in C++
why heap memory assign to dynamic block create by new operator
@khemchandrs
There are two types of memory.
One is the static memory or the compile-time memory that is used for variables and arrays declared in the program , those which the compiler can identify and allocate memory at runtime.
int a;
int b[1000];
The second memory is the heap memory or the dynamic memory. It can only be allocated at the runtime. There are various ways to allocate dynamic memory such as by using C functions like alloc( ) , calloc( ) etc. or by using the C++ ‘new’ operator.