title: Split array into sub blocks
body: <p>What I am trying to achieve is this:</p>
  
  <p>I have an image and I need to split it into sub blocks of 16x16 and I am working on the algorithm for this. For testing purposes though, I am using a small matrix:</p>
  
  <pre><code>A = {1, 2, 3, 4}
  </code></pre>
  
  <p>Now what I want to end up is this: 2 blocks containing:</p>
  
  <pre><code>A[1] = {1 2};
  A[2] = {3, 4}; 
  </code></pre>
  
  <p>I have tried to use the following:</p>
  
  <pre><code>double matrix[4] = {1, 2, 3, 4};
  
  for(int i = 0; (i &lt; 4); i++)
  {
          for(unsigned j=i; (j &lt; 2); j +=2)
          {
              std::cout &lt;&lt; j &lt;&lt; ' ';
          }
          std::cout &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>My thought process was to loop through the entire array (4) and then increment by 2 each time to create the 1x2 block. This did not work however. </p>
  
  <p>Where am I going wrong here?</p>