adspace


How the memory management in vectors are being done. What
happens when the heap memory is full, and how do you handle it ?

Answer Posted / Dhananjay Pal

In C++, vector manages its memory dynamically using the built-in library. When the capacity of a vector is reached, it automatically allocates more memory from the heap. If the heap memory is full, the program may crash or encounter errors. To avoid this, you can preallocate memory for vectors or handle exceptions.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

daily Routine of father

1484


What is the latest version on c++?

1206


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1164


Can union be self referenced?

1266


What character terminates all character array strings a) b) . c) END

1394