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!
Last edited on
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
Correct!
is a constant for a particular pc...correct?
Not exactly correct. PC is just hardware, it can run different operating system. The more accurate saying is that it's a constant for a particular version of STL installed.
thanks...cleared my doubt
Topic archived. No new replies allowed.