Re: realloc equivalent in C++
Posted in 1996
Enno Sandner — — source: Informix-list mailing list archive (1991-1998)
In article <4fgir1$pri@theory.tc.cornell.edu> hzhou@r26n05.tc.cornell.edu (Honbo Zhou) writes: Is there anything in C++ equvalent to realloc in C which can be used to increase allocated memory? Can't find this even in C++ books which talk about memory management specifically. Thanks. Honbo Nothing prevents you from using 'realloc' in C++ to allocate _raw-memory_. However you shouldn't mix the 'malloc/free/realloc/...' with the 'new/ new[]/delete/delete[]/...' families. The former are intended the maintain raw-memory while the latter manage the lifetime of objects. C++ has no direct support to reallocate an array of objects. Enno -- Enno