Answers for "go check length of array"

Go
3

how to get the length of an array in go

array:=[]int {1,2,3,4}
len(array)
Posted by: Guest on September-23-2020
0

go Array’s length is part of its type.

package main

func main() {
    a := [3]int{5, 78, 8}
    var b [5]int
    b = a
}
Posted by: Guest on October-18-2021

Browse Popular Code Answers by Language