Try to search your question here, if you can't find : Ask Any Question Now ?

multi-dimensional arrays in Go

HomeCategory: stackoverflowmulti-dimensional arrays in Go
Avatarcraig asked 2 weeks ago

I’m learning Go and I’m trying to generate a 2d array [][]int that in a nested for loop just puts a value in the spot

    for i := 0; i < 10; i++ {
        for j := 0; j < 10; j++ {
            genMap[i][j] = 1
        }
    }
    return genMap

This gives the error index out of range though. So I'm not really sure if this is possible in Go or I'm missing something crucial
1 Answers
Best Answer
AvatarArben answered 2 weeks ago
Your Answer

11 + 16 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com