Блог пользователя Mohsina_Shaikh

Автор Mohsina_Shaikh, история, 21 месяц назад, По-английски

Can anyone please explain why my program crashes without mentioning any error If I try to create vector of size 10^9 in c++.Anyway If I decrease the size of vector let's suppose to something like 10^7 and 10^6 it works fine

  • Проголосовать: нравится
  • -4
  • Проголосовать: не нравится

»
21 месяц назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

1 billion of int in vector would eat 4GB of memory. It's too much, if you have less than 4GB of free RAM.

»
21 месяц назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Vector max size is 1073741823, close to 10^9, but usual maximum that will pass is 10^7.