Go: Arrays

Declaring Arrays

var array_name[length]Type 

or 

var array_name[length]Typle{item1, item2, item3, ...itemN}

Multi-Dimensional Array

Array_name[Length1][Length2]..[LengthN]Type

Example:

a := [2][3]int{  
   {0, 1, 2} ,   /*  initializers for row indexed by 0 */
   {3, 4, 5} ,   /*  initializers for row indexed by 1 */
}

Leave a Reply

Your email address will not be published. Required fields are marked *