VB .NET:如何获取对二维数组中行的引用 [英] VB .NET: How to get reference to a row in a 2D-array
本文介绍了VB .NET:如何获取对二维数组中行的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个函数可以返回一维数组,如下所示:
I have a function that returns a 1D-array like this:
公共函数KeyConvert([args])as Byte()
和二维数组:
Public KeyList(15, 5) As Byte
可以看作15行,每行是一个众所周知的5元素数组。
Which can be seen as 15 rows,each row is a 5 element array, as we all already knew.
现在,我想调用该函数并将结果(一维数组)分配给一行(例如row) 4)在KeyList数组中。起初我认为代码应该是
Now I want to call the function and assign the result (which is a 1D array) to a row (say row 4) in the KeyList array. At first I thought the code should be like
Keylist(4) = KeyConvert([args])
但这没用。我找不到引用该特定行的方法。
But that didn't work. I cannot find a way to reference to that specific row.
所以有人有什么主意吗?非常感谢
So anybody have any idea? Thank you very much
推荐答案
您想要一个锯齿状阵列,而不是md阵列。
You want a jagged array, not a m-d one.
到:
Public KeyList(15)() As Byte
这篇关于VB .NET:如何获取对二维数组中行的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文