C++11 two dimensional array declaration and initialization

Hello all,

I'm having trouble declaring and initializing a two-dimensional array using the C++11 standard conventions. I would like to know how to do it in C++11 style as know how to use the old style.

the exception im getting is:

c++11_array_exp.cpp:37:3: error: too many initializers for ‘std::array<std::array<std::basic_string<char>, 6ul>, 22ul>’

you can find my code here:

Thanks for the help!

The error message is clear enough: too many initializers

If to compare your array with ordinary arrays then your array has 22 rows and 6 columns.
Last edited on
22 rows = outer
6 collums = inner

according to my initialization list of 22 elements which are each arrays of type string, where each inner element is a string such an initialization should not be false.
See this edited version of your code http://ideone.com/P4YIMC
Topic archived. No new replies allowed.