title: How to create fixed-size 2d array in swift
body: <p>Recently I am doing some code tests and found that fixed-size array creation is not as simple in Swift compare to other languages, say c++.</p>
  
  <p>I have seen the solution for 1d array here : <a href="https://stackoverflow.com/questions/24395105/how-to-create-a-fixed-size-array-of-objects#24395552">link</a>:</p>
  
  <p>One Dimension array, compare c++ with Swift:</p>
  
  <pre><code>// In c++
  
  int array1[64];    // 1-dimension array size 64
  
  // In Swift
  
  var array1 = [Int?](repeating: nil, count: 64) // 1 dimension array size 64
  
  </code></pre>
  
  <p>For 2-dimension array:</p>
  
  <pre><code>// in c++
  
  int array2[64][64]; // 2-dimension array size 64x64
  
  // in Swift
  
  var array2 : [[Int?]] = ???????
  
  </code></pre>
  
  <p>How to initiate a fixed-size 2d array in swift?</p>