Dynamic Memory

Dynamic memory allocation, through the use of functions like malloc() and realloc(), is a powerful tool that allows programmers to manipulate memory and variable storage. In this section, we go over how to use malloc(), and its counterpart free(), in relation to using pointers, as well as some good practices when allocating memory. Additionally, a few common mistakes are explained, many of which can be found using Valgrind.