title: how to declare and use right an std::array in C++
body: <p>I have this two-dimensional array : <strong><code>array &lt;array &lt;int , 4&gt; , 4&gt; myarray</code></strong></p>
  
  <p>How do I declare it right in a program?</p>
  
  <pre><code>//I first include
    #include &lt;array&gt;
  </code></pre>
  
  <p>then I initialize it</p>
  
  <pre><code>        array&lt;array&lt;int,4&gt;,4&gt; myarray = {{
                                             {1, 2, 3, 4},
                                             {5, 6, 0, 8},
                                             {9, 10, 11, 12},
                                             {13, 14, 15, 7}
                                          }};
  </code></pre>
  
  <p>I declare my functions:</p>
  
  <pre><code>        void func1(array&lt;array&lt;int,4&gt;,4&gt; );
          void func2();
          void func3(int&amp;, int&amp;, array&lt;array&lt;int,4&gt;,4&gt;);
          void func4(array&lt;array&lt;int,4&gt;,4&gt;);
          void func5(array&lt;array&lt;int,4&gt;,4&gt;);
          void func6(array&lt;array&lt;int,4&gt;,4&gt;);
  </code></pre>
  
  <p>write a main function:</p>
  
  <pre><code>    int main() {
                       func1(myarray);                                
                       func2();  
                       func3(myarray);  
                       func4(myarray);    
                       func5(myarray);   
                       func6(myarray);   
      return EXIT_SUCCESS;
      }
  </code></pre>
  
  <p>Then I write the functions</p>
  
  <pre><code>    void func1(array&lt;array&lt;int,4&gt;,4&gt; myarray)
          {//something 
          }
  
      void func2();
          {//something 
          }
  
      void func3(int&amp;, int&amp;, array&lt;array&lt;int,4&gt;,4&gt; myarray);
          {//something 
          }
  
      void func4(array&lt;array&lt;int,4&gt;,4&gt; myarray);
          {//something 
          }
  
      void func5(array&lt;array&lt;int,4&gt;,4&gt; myarray);
          {//something 
          }
  
      void func6(array&lt;array&lt;int,4&gt;,4&gt; myarray);
          {//something 
          }
  </code></pre>
  
  <p>Am I somewhere wrong ?</p>
  
  <p>The point is, that the initialized array :    <code>{1, 2, 3, 4},  {5, 6, 0, 8}, {9, 10, 11, 12},   {13, 14, 15, 7}</code> will be input in the first func . The output of the first func will be a different 4x4 array,for example <code>{15, 14, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {2, 1, 4, 13}</code>. This different array will be put as input in the second.The output of this func will be something different etc,etc....</p>
  
  <p>The <strong>problem</strong> that I have is that the output of most functions is the initialized array. </p>
  
  <p>Thanks for the help in advance. </p>