VB.net中结构体如何定义数组?
如简单的案例:
Public Structure Students
Public Name As String
Public Age As Integer
End Structure
Public student As Students
student.Name =" 1 "
student.Age=19
1.Name 我想定义成string类型含10个元素的数组,该如何定义?
2.结构体定义好了后,如何调用结构体中的元素?
student.Name=" 1 " 报错
请大侠指教,谢谢~~~
[解决办法]
public structure aa
public a as string
public sub new ( byval S as string,)
a = S
end sub
end structure
Dim clsaa(5) As aa
[解决办法]
Public Structure Students
Public Name(9) As String
Public Age As Integer
End Structure