The conversation between human and AI assistant.
How do I dynamically allocate a 1D in C?
How do I free the memory allocated using malloc?
You can use the free function to free the memory allocated by malloc, for example, free(ptr);.