Realloc will resize a block of memory larger or smaller. If it requires that the block be moved, it will copy the contents of the old memory into the new location and free the old memory.
Don On Sep 22, 12:01 pm, Ankuj Gupta <[email protected]> wrote: > Hi > > I have a doubt in functioning of realloc. Can we use realloc to shrink > the memory already allocated ? If yes, will it also free the left over > memory or programmer has to do it ? Also, while reallocating if it has > to move to some other location does the earlier location gets freed or > is it implementation dependent > > Thanks > Ankuj -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
