Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

go Iterating over an array in Golang

package main

import "fmt"

func main() {
    data := [...]string{"Ned", "Edd", "Jon", "Jeor", "Jorah"}
    for i := 0; i < len(data); i++ { //looping from 0 to the length of the array
        fmt.Printf("%d th element of data is %s
", i, data[i])
    }
}
 
PREVIOUS NEXT
Tagged: #Iterating #array #Golang
ADD COMMENT
Topic
Name
3+9 =