std::vector<type> fff;
} *fpn;
(f*)malloc(sizeof f)
is this wrong? ~latest msvc c++11 i have access violation _Pnext is 0xFFFFFFFFFFFFFFFF on push_back
did you call vector constructors as well somewhere?
even if they try to construct the vector i think that'll lead to heap corruption.
vectors do their own dynamic allocation, it's not good practice to use malloc on something where you don't fully control it's life time.
of course vectors will allocate their own stuff on heap. who knows how expected it is in this case. But this definitely will be another space and not one from the malloc in the code above. To call a vector constructor one can use in-place new
you mean placement new?
can't think of any reason why you would dynamically allocate a struct with two vectors
Обсуждают сегодня