What is the maximum size of an vector<>::maxsize()?

前端 未结 3 1448
庸人自扰
庸人自扰 2020-12-21 18:28

Please specify the range of vector list ....

I want to store million of records in vector<>.

I have to copy Millions of records from one vector<> to an

3条回答
  •  礼貌的吻别
    2020-12-21 18:49

    There's no limit except the available memory. But: a vector requires all the memory to be in one consecutive memory area. If you want to store a million records, there might not be such a big memory area available.

    In that case, it's better to use a deque instead of a vector.

提交回复
热议问题