Introduction
Dynamic memory lets a program get more memory while it runs. This helps when you don't know how much memory you need before the program starts.
When you want to store a list but don't know its size in advance.
When you need to create objects during the program based on user input.
When you want to use memory efficiently and only allocate what you need.
When working with data that changes size, like growing arrays or linked lists.