Logo

Programming-Idioms

History of Idiom 27 > diff from v14 to v15

Edit summary for version 15 by :
[Go] +DemoURL

Version 14

2015-11-30, 12:37:27

Version 15

2015-12-30, 17:14:12

Idiom #27 Create a 3-dimensional array

Declare and initialize a 3D array x, having dimensions boundaries m, n, p, and containing real numbers.

Idiom #27 Create a 3-dimensional array

Declare and initialize a 3D array x, having dimensions boundaries m, n, p, and containing real numbers.

Code
const m, n, p = 2, 2, 3
var x [m][n][p]float64
Code
const m, n, p = 2, 2, 3
var x [m][n][p]float64
Comments bubble
m, n, p must be constant for this syntax to be valid.
Here x is of type [2][2][3]float64, it is not a slice.
Comments bubble
m, n, p must be constant for this syntax to be valid.
Here x is of type [2][2][3]float64, it is not a slice.
Demo URL
http://play.golang.org/p/BMuuwLrp0q