As we can store 10^7 elements in array,if we are required to store the elements >= 10^9 then how can we do that?
Max no.of elements that can be stored in the std::vector
Depends on the limitations of the system that runs the program. On a 64 bit system, the maximum is most likely limited by the amount of physical memory your system has available.
if we are required to store the elements >= 10^9 then how can we do that?
Then call vec.resize(1'000'000'000)
. That's less than 4 gigabytes of memory (on typical systems).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.