|
|
- package main
-
- import "fmt"
-
- func defineArray() [10]int {
-
- var arr [10]int
- return arr
-
- }
-
- func main() {
-
- fmt.Printf("%#v\n", defineArray())
-
- // Array with size set from initialization
- // []int would be result in a slice
- bla := [...]int{1, 2, 3, 4, 5}
- fmt.Printf("%#v\n", bla)
-
- }
|