title: Initialization array of two dimensional arrays
body: <p>How to initialize array of two dimensional arrays in C++ (defined like in code below)?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;array&gt;
  
  typedef int arr3by6Int[3][6];
  typedef arr3by6Int arr3xarr3by6Int[3];
  
  void print3by6(arr3by6Int arr)
  {
      for(int i = 0; i &lt; 3; i++)
      {
          for(int j = 0; j &lt; 6; j++)
          {
              std::cout &lt;&lt; arr[i][j] &lt;&lt; " ";
          }
          std::cout &lt;&lt; std::endl;
      }
  }
  int main(int argc, char const *argv[])
  {
  
      arr3by6Int a = {
          {1,2,3,4,5,6},
          {0,0,0,0,0,0},
          {2,2,2,2,2,2}
      };
  
      arr3by6Int b = {
          {2,2,3,4,5,6},
          {0,0,0,0,0,0},
          {2,2,2,2,2,2}
      };
  
      arr3by6Int c = {
          {3,2,3,4,5,6},
          {0,0,0,0,0,0},
          {2,2,2,2,2,2}
      };
  
      arr3xarr3by6Int d = { a, b, c };
  
      for(int i = 0; i &lt; 3; i++)
      {
          print3by6(d[i]);
      }
      return 0;
  }
  </code></pre>
  
  <p>I get these errors:</p>
  
  <blockquote>
    <p><code>$ g++ -std=c++11  arrays.cpp -o arrays</code><br>
    <code>arrays.cpp: In function ‘int main(int, const char**)’:</code><br>
    <code>arrays.cpp:39:32: error: array must be initialized with a brace-enclosed initializer</code><br>
    <code>arrays.cpp:39:32: error: array must be initialized with a brace-enclosed initializer</code><br>
    <code>arrays.cpp:39:32: error: array must be initialized with a brace-enclosed initializer</code></p>
  </blockquote>