void free(void *p) performs which of the following functions?
Answer: B
Correct answer: de-allocates space to which p points
free(p) returns to the heap the block that p points to, obtained earlier from malloc, calloc or realloc. It does not change p itself, which is why the pointer should be set to NULL afterwards - using it again, or freeing it twice, is undefined behaviour.
Please log in or register to report this question.