Suppose my vector size is defined as 6.
vector<int>v(6);
But when I output , it doesn't give me error.
cout<<v[7]; //works
I know how vector actually grow , they will predefine some size x
and the double it. So it can be acceptable for position 7.
But it still works for position 10000 why? Why can I access a memory location so far which I haven't declared?
cout<<v[10000]; //works