C++ large array of vectors

前端 未结 2 1281
情歌与酒
情歌与酒 2021-01-17 08:29

I\'m having some troubles with a large array of vectors in C++. Basicaly I wan\'t an array of 2 millions elements, and each elements is a vector (It

2条回答
  •  粉色の甜心
    2021-01-17 08:44

    This is helpfull

    Dynamically allocate memory for my_List. or

    Declare your array of vector of int's(my_List) as a global variable and size a `const. Thier storage locations are by design big enough to allocate such large mermory size.

    For local variable, the stack segment might be to small to allocate 2e6*24B.

提交回复
热议问题