Memory in your C++ program is divided into two parts: In other words, dynamic memory Allocation refers to performing memory management for dynamic memory allocation manually. For de-allocating dynamic memory, we use the delete operator. It is the job of the programmer to de-allocate dynamically created space. Memory de-allocation is also a part of this concept where the 'clean-up' of space is done for variables or other data storage. Storing its address in a pointer (so that space can be accessed).Programmers can dynamically allocate storage space while the program is running, but programmers cannot create new variable names 'on the fly', and for this reason, dynamic allocation requires two criteria:
In this case, the exact space or number of the item does not have to be known by the compiler in advance. Exact size and storage must be known at compile time and for array declaration, the size has to be constant. There are two ways via which memories can be allocated for storing data. # Another Dynamic Allocation Program Using Constructor What is memory Allocation?