Pre allocate memory

I need to store alot of data in a vector but don’t know in advance how much. Is there a way to pre allocate memory for my vector? What is best practice in these cases?

When creating the vector a fixed size pre-allocation can be used.

vector(number) x[mystartsize];

Along the way you can then resize or concat at the end. (Or push_back). However these operations will create copy(ies) of the original.