I encountered this small piece of code in this question, & wanted to know,
Can the realloc()
function ever move a memory block to another location, when the memory space pointed to is shrinked?
int * a = malloc( 10*sizeof(int) );
int * b = realloc( a, 5*sizeof(int) );
If possible, under what conditions, can I expect b
to have an address different from that in a
?