std::vector
will take both a size and an initial value, which you can use to set initial size of both the outer and inner vector:
vector< vector<int> > myArray(SIZE1, vector<int>(size2));
boost::multi_array
is specifically designed as a multidimensional array, and is more fitting than boost::scoped_array
.
boost::multi_array<int, 2> myArray(boost::extents[SIZE1][size2])