can we store extra elements in the vector more than the twice the size?if for example
vector a(5,0);
// now if we cin more than 10 elements will the exist in the vector?
can we store extra elements in the vector more than the twice the size?if for example
vector a(5,0);
// now if we cin more than 10 elements will the exist in the vector?
@lakshaygarg128
hello lakshay,
yeah ,vector is dynamic array if it get fill upto it capacity then its size will increase to twice the current size.
if we do not define the size of the vector then what is the maximum limit of size?
@lakshaygarg128
then initailly ur vector size will be zero (means vector is empty).
and its size will increase like 1,2,4,8,16,so on