问题
单项选择题
若在窗体模块的声明部分声明了如下自定义类型和数组:
Private Type rec
Code As Integer
Caption As String
End Type
Dim arr(5)AS rec
则下面的输出语句中正确的是( )
A.Print arr.Code(2),arr.Caption(2)
B.Print arr.Code,arr.Caption
C.Print art(2).Code,arr(2).Caption
D.Print Code(2).Caption(2)
答案
参考答案:C
解析: 本题定义了元素为5的数组,并且定义Code和Caption都为整型,正确输出语句应为Print arr(2).Code,arr(2).Caption。