Free memory in C Programming | Sololearn: Learn to code for FREE!


Free memory in C Programming

How can I free memory of an array of pointers without knowing the size of the array? For example: char *planet[]

4/8/2021 3:35:04 PM


9 Answers

New Answer


thank you Coder Kitten


The array is used as parameter for a function. Thanks all, I solved the problem by using pointer to pointer to traverse though the array. Martin Taylor Coder Kitten


Thanks 🌹 for the Help


char **planets; planets = malloc(sizeof(char*) * 8); this function is use for the memory of numbers in c.