Original Post
Hi! I'm wondering what would be the most appropriate use of arrays/vectors if the final size is unknown? I've been using std::vector / std::list for this before but I thought maybe I can do the following instead? Would this save me speed in the end? Or simply make it more error-prone?
std::vector<vertex> list;
//for all new vertices...
list.push_back(...);
vertex *newlist;
newlist = new vertex[list.size()];
//assign list to newlist;
list.clear();