On Aug 11, 8:49*am, "saneman" <as...@asd.com> wrote:
> std::vector<int> v creates a dynamic array where its possible to insert new
> elements without doing any preallocation. But how about a dynamic double
> array? I would like to have something like:
>
> int M[a][b];
>
> where a and b change be set during runtime and the size og M can vary, is
> that possible?
Try:
std::vector< std::vector<int> > M;
Depending on your application, there may be better ways to do it. See
also this FAQ and following:
http://www.parashift.com/c++-faq-lit...html#faq-16.17
Cheers! --M