golang passing an array to a function

package main
import “fmt”
func fp(a *[3]int) { fmt.Println(a) }
func main() {
for i := 0; i < 3; i++ {
fp(&[3]int{i, i * i, i * i * i})
}
}

 

posted on 2015-05-08 10:34  rojas  阅读(188)  评论(0编辑  收藏  举报