How to get the maximum number of elements that could be insert in vector in C++

1 Answer

0 votes
#include <iostream>
#include <vector>

int main ()
{
    std::vector<int> v = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
 
    std::cout << v.max_size();
 
    return 0;
}
 
 
 
/*
run:
 
2305843009213693951
  
*/

 



answered Apr 9, 2020 by avibootz
...