I have a 2D char
vector:
vector< vector > matrix;
I will read in a matrix as an input and store it in that v
const size_t ROW = 10;
const size_t COL = 20;
std::vector> v;
v.resize( ROW );
std::for_each( v.begin(), v.end(),
std::bind2nd( std::mem_fun_ref( &std::vector::resize ), COL ) );
std::cout << "size = " << v.size() << std::endl;
for ( const std::vector &v1 : v ) std::cout << v1.size() << ' ';
std::cout << std::endl;