首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

VB.net中结构体怎么定义数组

2011-12-19 
VB.net中结构体如何定义数组?如简单的案例:Public Structure StudentsPublic Name As StringPublic Age As

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

热点排行