Subj : Re: realloc() issue on C++ To : borland.public.cpp.borlandcpp From : Mohsen Date : Mon Mar 21 2005 01:27 am "José Mauro" wrote: >Yes, std::vector is the clean solution for a new code. > >However, my problem is practical. I have 15000 lines of ANSI C code, >converted to C++ and making use of templates to apply the algorithm in >custom data types. The original malloc() and free() calls were converted >to new [] and delete [], to guarantee constructors and destructors calls >for each array element. For the realloc() calls, i need a way to expand >the memory, now obtained through the new [] operator. > >Someone know a "quick & dirty" way to solve this problem? > Isn't it easier to overload realloc() function or even new operator to allocate the memory you want and to copy necessary stuffs into new memory? Mohsen .