Programming Language/Golang
[Golang] 고랭 배열을 선언하는 방법
package main import ( "fmt" "reflect" ) func main() { var array_1 [5]int = [5]int{1, 2, 3, 4, 5} var array_2 = [...]int{1, 2, 3, 4, 5} fmt.Println(reflect.TypeOf(array_1)) // [5]int fmt.Println(reflect.TypeOf(array_2)) // [5]int fmt.Println(array_1) // [1 2 3 4 5] fmt.Println(array_2) // [1 2 3 4 5] }