回 帖 发 新 帖 刷新版面

主题:多维数组的初始化?

dim pe( ,) as Boolean  ={
                     {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                     {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                     {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                     {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                     {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
                     {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
                     {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}

                                                             但是vb.net提示错误,请问多维数组如何初始化?谢谢!

回复列表 (共2个回复)

沙发

怎么没人呀?

板凳

Dim pe(,) As Boolean = {{0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}

只要你写在一行 上,就会没有错误的

我来回复

您尚未登录,请登录后再回复。点此登录或注册