new
does not support that.
You can mimic the behavior of realloc
manually using new
, delete
and memcpy
.
By the way, you should always use the same family of methods i.e. either malloc
/ realloc
/ free
or new
/ delete
, and not mix realloc
with new
/ delete
. See for example the FMM errors reported by Purify.