4 ms·
That's not how I interpret that. Both the specification of malloc() and realloc() contain this phrase: > The pointer returned if the allocation succeeds is sui
by pdw 11y ago
That's not how I interpret that. Both the specification of malloc() and realloc() contain this phrase:
> The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallocated).
(Emphasis added.) After realloc() succeeds, you can no longer use the original pointer.