初始化:

  • var array [2][3]int = [2][3]int{{0,0,0},{0,0,0}}
  • var array [2][3]int = [...][3]int{{0,0,0},{0,0,0}}
  • var array = [2][3]int{{0,0,0},{0,0,0}}
  • array := [2][3]int{{0,0,0}.{0,0,0}}

二维数组在内存空间的表示:

 

 

 二维数组的遍历: