moving the data if not contiguous space needed. Why do you think realloc(a,X) should change b or memory pointed by b at all?
a is pointing to 0x01 and its 10bytes so it uses from 0x01 to 0x0a b is pointing to 0x0b and it can use from 0x0b to 0x0e If I use realloc and make a able to use 16bytes it will make a able to use from 0x01 to 0x10 So if memory pointed by b was set to bbb and after realloc a was set to aaaaaaaaaaaaaaaa wouldn't it change bbb to aaa?
Обсуждают сегодня