正在加载图片...
41数组的概念 数组是一组相同类型数据的集合。可用数组名代表这一批数。 组成数组的每个数据都是该数组的元素,用数组名(下标)来 表示。例: Dima(1to10) as integer'定义a是下标为1至10的一维整型数组 a(1)a(2)a(3)a(4)a(5)a(6)a(7)a(8)a(⑨)a(10) dimb(10) as integer'若省略下标上界,则默认为0,b(0)-b(10) dim c(1 to 3, 1to 4)as integer c(1, 1 ) c(1, 2)c(1, ) c(1, 4) C为3×4的二维数组 c(2,1)c(2,2)c(2,3)c(2,4) c(3,1)c(3,2)c(3,3)c(3,4) Dimd(2,3) as string'd为3×4的二维数组,元素为d(0,0)~d(2,3) Dim eo as single'e为动态数组,维数和下标范围都没确定4.1 数组的概念 •数组是一组相同类型数据的集合。可用数组名代表这一批数。 •组成数组的每个数据都是该数组的元素,用数组名(下标)来 表示。例: Dim a(1 to 10) as integer ’定义a是下标为1至10的一维整型数组 a(1) a(2) a(3) a(4) a(5) a(6) a(7) a(8) a(9) a(10) dim b(10) as integer ’若省略下标上界,则默认为0,b(0)~b(10) dim c(1 to 3,1to 4) as integer c(1,1) c(1,2) c(1,3) c(1,4) c(2,1) c(2,2) c(2,3) c(2,4) c(3,1) c(3,2) c(3,3) c(3,4) Dim d(2,3) as string ’d为3×4的二维数组,元素为d(0,0)~ d(2,3) Dim e() as single ’e为动态数组,维数和下标范围都没确定 C为3×4的二维数组
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有