How do you free allocated memory?
Answer: B
Correct answer: free(var-name);
free() returns memory obtained from malloc, calloc or realloc to the heap. delete is the C++ operator, and the other two names do not exist. Freeing the same block twice, or using a pointer after freeing it, is undefined behaviour.
Please log in or register to report this question.