c++ memory allocation

Jan 16, 2010 at 1:55pm
is there something similar in c++ to realloc in c ?
Jan 16, 2010 at 2:06pm
Not really, but quoting Strourtrup:
If you feel the need to use realloc(), consider relying on a standard container instead; doing that is usually simpler and just as efficient
The C++ Programming Language §19.4.6
Jan 16, 2010 at 2:25pm
thnks
Jan 16, 2010 at 3:44pm
I would say std::vector<>'s auto-resizing capabilities are the closest thing
to realloc.
Jan 16, 2010 at 5:54pm
You also have the allocator class although I'm not sure if that's what you're looking for.
Topic archived. No new replies allowed.