如何在vb.net中的二维数组中存储值 [英] How to Store values in 2 dimensional array in vb.net
本文介绍了如何在vb.net中的二维数组中存储值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在vb.net中存储2维数组中的值。我这样写但是不正确
Dim arr(,)As 字符串
对于i as Integer = 0 至 10
对于j As Integer = 0 至 1
ReDim Preserve arr(alX (i),alY(i))
下一个
下一个
解决方案
你可以使用这个代码.. ...
Const ARR_SIZE_X 作为 整数 = 9999999
Const <> span ARR_SIZE_y 作为 整数 = 5
Dim a2(ARR_SIZE_y,ARR_SIZE_X)作为 Double
对于 y = 0 ARR_SIZE_y
对于 x = 0 ARR_SIZE_X
Redim 保留a2(ARR_SIZE_y,ARR_SIZE_X)
a2(y,x)= a1(x)
下一步
下一步跨度>
How to Store values in 2 dimensional array in vb.net.I written like this but its not correct
Dim arr(,) As String
For i As Integer = 0 To 10
For j As Integer = 0 To 1
ReDim Preserve arr(alX(i), alY(i))
Next
Next
解决方案
you Can use this code.....
Const ARR_SIZE_X As Integer = 9999999 Const ARR_SIZE_y As Integer = 5 Dim a2(ARR_SIZE_y, ARR_SIZE_X) As Double For y = 0 To ARR_SIZE_y For x = 0 To ARR_SIZE_X Redim preserve a2(ARR_SIZE_y,ARR_SIZE_X) a2(y, x) = a1(x) Next Next
这篇关于如何在vb.net中的二维数组中存储值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文