c++ memory allocation

is there something similar in c++ to realloc in c ?
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
thnks
I would say std::vector<>'s auto-resizing capabilities are the closest thing
to realloc.
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.