AhmedIbrahim30's blog

By AhmedIbrahim30, history, 14 months ago, In English

what the max vector size limit in array or vector in c++?

  • Vote: I like it
  • -19
  • Vote: I do not like it

»
14 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Maybe 9,223,372,036,854,775,807,which is from cppreference.com. Acturaly, it is up to your Memory limitation.I have done experiments on my computer (Core i3-3110M, 8GB of RAM) and found that the maximum size I can allocate is about 1/2 of the remaining RAM.

»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

There is method of std::vector — max_size, that return maximum size of vector with given template type.