Vector size allocation

i want to know what is the difference between size and capacity and is the capacity fixed for any array??
and since vector is dynamic array so why is its size not infinite why does it have a max size


Read the above page for the difference between size and capacity methods of vector class. It is very well explained over there.
Vector is dynamic array. So we can change its size as and when required according to our needs. Infinite size does not have any physical significance. So it always has a max size.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.