I can create a 2D array of size n*m
by doing:
vector< vector< int > > foo(n, vector< int > (m))
.
Suppose that at runtime I'm given a variable number of values,
e.g. v_1, v_2, v_3, ..., v_k
and want to create the following:
vector< vector< ... vector< int > ... > > foo(v_1, vector< ... > (v_2, vector< ... > ..));
In other words create a multidimensional array of size v_1* v_2 * v_3 ... *v_k
. How can I do this? Is this possible?