vectors

my question is regarding the max_size of a vector (not the capacity of a vector!).
the
myvector.max_size()
gives 1073741823 on my pc.
suppose i have 2 vectors:

1
2
vector<int> A
vector<double> B


so does that mean i can have 1073741823 elements in A as well as B?
if yes, then that means the max no of elements that a vector can have does not depend on the type of entity (int or double) being stored...& is a constant for a particular pc...correct?
Thank You!
if yes, then that means the max no of elements that a vector can have does not depend on the type of entity (int or double) being stored...& is a constant for a particular pc...correct?

It does depend on the type (or rather, it can). Why didn't you just try it out?
Note that you usually can't actually reach the number of elements indicated by max_size(), even if you have enough physical RAM. Your program's address space will already be exhausted before that.
Topic archived. No new replies allowed.