vector<Type> vect;
will allocate the vector
, i.e. the header info, on the stack, but the elements on the free store ("heap").
vector<Type> *vect = new vector<Type>;
allocates everything on the free store.
vector<Type*> vect;
will allocate the vector
on the stack and a bunch of pointers on the free store, but where these point is determined by how you use them (you could point element 0 to the free store and element 1 to the stack, say).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…