I’m aware that there is a realloc function that would allow me to resize the memory block (and it’s paired with a free function). However, I’m trying to do the same to a c++ class with some member pointers allocated memory using new instead of realloc. Is there an equivalent keyword to realloc in c++ that would allow me to achieve the same goal when the memory is paired using new/delete rather than malloc or realloc and free?
Thanks in advance.
No, there isn’t. And frankly, if you are using new or new[]. your C++ code is probably not well designed. Look at using std::vector instead of new[], and at using values instead of new.