我需要分配一个包含 6227020800
元素的 vector 。对于常规调用来说,它显然太大了:
vector<int> largevector(6227020800)
我尝试使用 new,但它太大了:
vector<int> largevector= new vector<int>[6227020800]
有没有办法分配这么大的 vector ?
最佳答案
看看stxxl图书馆。
关于c++ - 为 vector 分配大量空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10256677/