[ create a new paste ] login | about

Link: http://codepad.org/nAoPi7cV    [ raw code | output | fork ]

C++, pasted on Apr 22:
1
2
3
4
5
6
7
8
9
int main()
{

   std::cout << "Max elements that can be inserted into a vector having elements of size '" << sizeof( int )
             << "' is: " << std::vector<int>().max_size() << std::endl;

   std::cout << "Max elements that can be inserted into a vector having elements of size '" << sizeof( std::vector<int> )
             << "' is: " << std::vector<std::vector<int> >().max_size() << std::endl;
}


Output:
1
2
Max elements that can be inserted into a vector having elements of size '4' is: 1073741823
Max elements that can be inserted into a vector having elements of size '28' is: 153391689


Create a new paste based on this one


Comments: