Free memory in C Programming | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

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[]

8th Apr 2021, 3:35 PM
feof
feof - avatar
4 Answers
+ 3
thank you Coder Kitten
8th Apr 2021, 4:13 PM
feof
feof - avatar
+ 2
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
8th Apr 2021, 9:54 PM
feof
feof - avatar
+ 1
Thanks 🌹 for the Help
19th Aug 2021, 11:46 AM
Shubham Bhatia
Shubham Bhatia - avatar
+ 1
char **planets; planets = malloc(sizeof(char*) * 8); this function is use for the memory of numbers in c.
13th Sep 2021, 5:16 PM
Shubham Bhatia
Shubham Bhatia - avatar