Concept

How do you deallocate dynamically allocated arrays?

ComputerScienceOne / Using Arrays with Functions

"Once dynamically allocated memory is no longer needed, we should release it so that it can be reused by the program or the operating system. The free() function in the standard library does this for us. All we need to do is provide the pointer to free() and it deallocates the memory block.\n\n1 free(arr);\n\nOnce freed, accessing old memory pointed to by the arr pointer is undefined behavior and may lead to unexpected or fatal results."

Related Ideas

How do you deallocate dynamically allocated arrays? | ComputerScienceOne | Bifalgorithm | Bifalgorithm