Doubt in pushback()

i am not able to understand how the pushback() works and effects the capacity

hello @dreamerekta

push_back() function is used to push elements into a vector from the back. The new value is inserted into the vector at the end, after the current last element and the container size is increased by 1.
now if after insertion vector capacity become full then in that time reallocation will happen and vector capacity will get doubled.

you shoudl watch the once again,prateek bhaiya has covered this very well.

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.