...

/

Dynamically Allocated Memory

Dynamically Allocated Memory

Learn how to control the amount of memory allocated for a variable on a heap by using some built in C functions.

Languages like MATLAB, Python, etc, allow us to work with data structures like arrays, lists, etc, that we can dynamically resize. That is to say, we can make them longer, shorter, etc, even after they are created. In C, this is not so easy.

Once we’ve allocated a variable such as an array on the stack, it is fixed in its size. We cannot make it longer or ...