title: initializing property of structure
body: <p>I'm new to c, and currently making chess program.</p>
  <p>There's the code.</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int spider[8][2] = {{0, 1}, {1, 1}, {1, 0}, {1, -1}, 
                  {0, -1}, {-1, -1}, {1, 0}, {-1, 1}};
  
  int jump[8][2] = {{1, 2}, {2, 1}, {2, -1}, {1, -2}, 
                {-2, -1}, {-1, -2}, {-1, 2}, {-2, 1}};
  
  typedef struct
  {
      int color;
      int type;
  
      char symbol;
  
     int unit[8][2];
  } piece;
  
  void add_piece(piece piece, int color, int type, char symbol, int unit[8][2])
  {
      piece.color = color;
      piece.type = type;
  
      piece.symbol = symbol;
  
      for(int i = 0; i &lt; 8; i++)
      {
          for(int j = 0; j &lt; 2; j++)
          {
              piece.unit[i][j] = unit[i][j];
          }
      }
  }
  
  int main(void)
  {
      piece wk;
      add_piece(wk, 0, 0, 'K', spider);
  
      printf(&quot;%d&quot;, wk.color);
  
      return 0;
  }
  </code></pre>
  <p>expected output : 0</p>
  <p>console output : 8388608</p>
  <p>I found that 8GB = 8388608KB.</p>
  <ol>
  <li><p>What's the meaning of that output?</p>
  </li>
  <li><p>Is there any problem of initializing property of structure or elsewhere?</p>
  </li>
  <li><p>Can you see some not good habits in this code?</p>
  </li>
  </ol>