For user defined size: vector<vector<int>> vec( n ); where n -> number of rows vector<vector<int>> vec( n , vector<int> (m, 0)); where n -> number of rows where m -> number of columns (all initialized with 0)