12345678910111213141516171819202122232425
#include <iostream> #include <vector> int main() { // https://cal-linux.com/tutorials/vectors.html std::vector< std::vector<int> > array_of_arrays ; // array of array of int ; array_of_arrays.push_back( { 10, 11, 12, 13 } ) ; array_of_arrays.resize(4) ; array_of_arrays[1] = { 14, 15, 16 } ; array_of_arrays[2] = { 17 } ; array_of_arrays[3] = { 18, 19, 20, 21, 22, 23 } ; array_of_arrays[0].push_back(99) ; for( const auto& array : array_of_arrays ) { std::cout << "[ " ; for( int v : array ) std::cout << v << ' ' ; std::cout << "]\n" ; } }