本文介绍了如何声明嵌套的结构数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我的问题是如何在VB.Net中声明一个嵌套的结构数组(如果这就是你所说的那样)



基本上我想这样做:



Hi all

My question is how to declare a nested array of structures (If that is what you call it) in VB.Net

Essentially I would like to do this:

Year(5).Month(3).Day(3) = 123 '(arbitary number)





我是VB.NET的新手,如果有人问过这个问题,我很抱歉



非常感谢任何链接或评论



I'm new to VB.NET and I apologise if this has been asked before

Any link or comment would be greatly appreciated

推荐答案


Module Module1

    Sub Main()

        Dim Year As Year = New Year()

        Year(5).Month(11).Day(3) = 123

    End Sub

End Module

Class Year
    Inherits List(Of Year)

    Public Month(12) As Month

End Class

Class Month
    Inherits List(Of Month)

    Public Day(31) As Integer
End Class


这篇关于如何声明嵌套的结构数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 17:05