Use malloc instead of std::vector