3 ms·
Maybe you're getting mixed up with Java, but that example type is wrong, since you used `new`, the vector was allocated in the heap and the appropriate type is
by wrongexample 7y ago
Maybe you're getting mixed up with Java, but that example type is wrong, since you used `new`, the vector was allocated in the heap and the appropriate type is a pointer type: `vector<T>*`.
What's more, that's a highly unusual example. Rarely would you need to heap allocate a vector. In the case of stack allocation the syntax would be `vector<T> myVec` which is as succinct as possible.