1.

void free(void *ptr) deallocates the memory previously allocated by a call to _______________or _________(a) malloc,getenv,abort(b) calloc,malloc,exit(c) calloc,malloc,realloc(d) exit,getenv,abortThis question was posed to me in an interview for internship.Asked question is from General Utilities in division C Library of C

Answer»

Correct option is (c) calloc,MALLOC,realloc

To explain I would SAY: The free() function causes the space to be deallocated that are pointed to by ptr, that is, made AVAILABLE for further allocation. No action occurs if ptr is a null pointer. Otherwise, if the ARGUMENT does not match a pointer EARLIER returned by the calloc. malloc, or realloc function.



Discussion

No Comment Found

Related InterviewSolutions