Answered Questions

  • Difference between realloc() and free()?  

    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...

    Roopesh Majeti

    • May 27th, 2007

    Mitra,as you mentioned that realloc will delete the existing memory and allocate the new memory . I tried it on solaris and following is found :1. If the new size allocated is less than the existing m...