Doubts in static memory allocation and dynamic Memory allocation

what is the difference between static memory allocation and dynamic memory allocation

Hey @Tiwary725
In static memory allocation, once the memory is allocated it cannot be changed. The memory is not reusable. But in dynamic memory allocation, once the memory is allocated it can be changed. The key difference between static and dynamic memory allocation is that in static memory allocation once the memory is allocated, the memory size is fixed while in dynamic memory allocation, once the memory is allocated, the memory size can be changed.
Static memory is allocated during compile time.
In Dynamic Memory Allocation, Allocation of memory is done at the time of execution (run time).
New and Delete operators are used in dynamic memory allocation.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.