Skip to content

Instantly share code, notes, and snippets.

@john-nash-rs
Created May 1, 2020 12:14
Show Gist options
  • Save john-nash-rs/dd33bccda286c2f9286de46512e73097 to your computer and use it in GitHub Desktop.
Save john-nash-rs/dd33bccda286c2f9286de46512e73097 to your computer and use it in GitHub Desktop.
func main() {
var a [3]int = [3]int{1,2,3}
fmt.Println("Element at index is",a[1])
fmt.Println("Length of array is",len(a))
for i, v := range(a){
fmt.Printf("Index is %d, and value is %d \n",i,v)
}
q := [...]int{1, 2, 3}
fmt.Println("Length of array is",len(q))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment