Created
May 25, 2019 00:53
-
-
Save saulcosta/702b1492c38b16805a07ba87c24ea478 to your computer and use it in GitHub Desktop.
VS Code launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var a [5]int | |
fmt.Println("emp:", a) | |
a[4] = 100 | |
fmt.Println("set:", a) | |
fmt.Println("get:", a[4]) | |
fmt.Println("len:", len(a)) | |
b := [5]int{1, 2, 3, 4, 5} | |
fmt.Println("dcl:", b) | |
var twoD [2][3]intfor i := 0; i < 2; i++ { | |
for j := 0; j < 3; j++ { | |
twoD[i][j] = i + j | |
} | |
} | |
fmt.Println("2d: ", twoD) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment