Tutorial by Examples

An array in go is an ordered collection of same types elements. The basic notation to represent arrays is to use [] with the variable name. Creating a new array looks like var array = [size]Type, replacing size by a number (for example 42 to specify it will be a list of 42 elements), and replacing...
Multidimensional arrays are basically arrays containing others arrays as elements. It is represented like [sizeDim1][sizeDim2]..[sizeLastDim]type, replacing sizeDim by numbers corresponding to the length of the dimention, and type by the type of data in the multidimensional array. For example, [2]...
Arrays values should be accessed using a number specifying the location of the desired value in the array. This number is called Index. Indexes starts at 0 and finish at array length -1. To access a value, you have to do something like this: arrayName[index], replacing "index" by the num...

Page 1 of 1