title: Printing 2D-Arrays side-by-side in C
body: <p>The following are my functions:</p>
  
  <pre><code>void initialize(char box[NROW][NCOL]){
      int x,y;
      for(x=0; x&lt;NROW; x++)
          for(y=0; y&lt;NCOL; y++)
              if (x==0 || x==NROW-1 || y==0 || y==NCOL-1)
                  box [x][y] = '=';
              else{
                   box[x][y]=' ';
              }
  
  }
  
  void display(char box[NROW][NCOL]){
  
      int x,y;
      for(x=0; x&lt;NROW; x++){
      for(y=0; y&lt;NCOL; y++){
         printf(" %c ", box[x][y]);
      }
          printf("\n");
      }
  }    
  
  void puzp1(char puz1[NROW][NCOL]){
  
      int x,y;
  
      for(x=1; x&lt;NROW-1; x++){
      for(y=1; y&lt;=x; y++){
          puz1[x][y]='*';
      }
      }
  
  }
  
  void puzp2(char puz2[NROW][NCOL]){
  
      int b,c;
      for(b=1; b&lt;NROW; b++){
          for(c=1; c&lt;NROW-b; c++){
              if(b!=3 &amp;&amp; c!=3 ){
                  puz2[b][c]='+';
                  }
                  }
              }
  }
  </code></pre>
  
  <p>The following is my main:</p>
  
  <pre><code>int main(void){
  
      char ar1[NROW][NCOL];
      char ar2[NROW][NCOL];
  
      printf("Puzzle Piece 1:\n");
      initialize(ar1);
      puzp1(ar1);
      display(ar1);
  
  
      printf("Puzzle Piece 2:\n");
      initialize(ar2);
      puzp2(ar2);
      display(ar2);
  </code></pre>
  
  <p>I realize that there is another thread with a similar question but it does not quite satisfy what I need. What's happening here is that <code>initialize</code> generates a hollow rectangle, <code>puzp1</code> and <code>puzp2</code> decides the content and <code>display</code> prints the content.</p>
  
  <p>Is it possible for me to print these two 2D arrays side-by-side; if possible, how?</p>
  
  <p>NROW and NCOL are constants.</p>
  
  <p>Thank you.</p>