vector as class member

Is it allowed to have a vector of undefined size as a private member of a class? Can the vector be resized once an instance of that class has been created? How would we make the constructor of such class? Thanks.
Is it allowed to have a vector of undefined size as a private member of a class?

If you mean "arbitrary size", then yes.

Can the vector be resized once an instance of that class has been created?

Yes. The structure size of a vector is constant, it gets its storage for its elements from the free store/heap.

How would we make the constructor of such class?

You don't need to do anything special.
Topic archived. No new replies allowed.