func Pic(dx, dy int) [][]uint8 {
pic := make([][]uint8, dy)
for i := 0; i < dy; i++ {
pic[i] = make([]uint8, dx)
for j := 0; j < dx; j++ {
pic[i][j] = uint8(float64(i)*math.Log(float64(j)))
}
}
return pic
}



在 2010年5月5日星期三 UTC+8上午12:30:56,Yang Yang写道:
>
> Hi, All 
>
> I'm new to Go programming language. I want to initialize a two 
> dimension array. 
> But I cannot find how to do it in the document. 
> Is there a way to initialize [3][3]int in declaration. 
>
> Best regards 
>
> Yang 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to