What function should be used to free the memory allocated by calloc() ?
Answer: C
Correct answer: free();
Memory from calloc is released by free, exactly as memory from malloc or realloc is. There is one deallocation function for all three.
That is possible because all three obtain their storage from the same allocator; the difference between them lies in how the block is sized and whether it is zeroed, not in where it comes from. The other names offered are not part of standard C.
Please log in or register to report this question.