Regarding Dynamic Arrays

Can you give me an example of a program in which we first have a dynamic array with memory requirement of array of 100 elements and now we requires 200 element and we can increase it in the same array of 100 elements ?
or we just have to delete the old array and then take a new array?

hey @ujjaval2910_49c81b3ea336fd88 array assigns a chunck of memory when initialized, so we can only inititalise it only one time with a size. You can achieve your this goal, doing 2 things. Either make a new array of the size 200 element, store 100 elements in it from previous array, and then new 100 elements, or you can use vector to achieve this objective.

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.