Friday, February 27, 2015

Difference between realloc() and free()?  

Question:Difference between realloc() and free()?  ?

Answer: The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer  

Tags:Interview Questions, Languages, C++,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement




Medical Billing Software

Hospital Management System Software

Hospital Management System (HMS) Software is developed for multispeciality hospitals, to cover a wide range of hospital administration and management processes with financial accounting, voucher entry, pharmacy, patients module etc features...

No comments:

Post a Comment