[ create a new paste ] login | about

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

C++, pasted on Apr 22:
1
2
3
4
5
6
7
int main()
{
   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;

   std::vector<std::vector<int> > myvec(10000000);
}


Output:
1
2
3
Max elements that can be inserted into a vector having elements of size '28' is: 153391689
std::bad_alloc: St9bad_alloc
Aborted.


Create a new paste based on this one


Comments: