关于锯齿状阵列。 [英] About a jagged array.

查看:101
本文介绍了关于锯齿状阵列。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么(Console.WriteLine(c(1)(1)))打印出零?

并解释我 c(1)= System.Array.CreateInstance(GetType(System.Int32),10 )?



I'd wonder why (Console.WriteLine(c(1)(1))) printed out Zero?
And explain me what is role of c(1) = System.Array.CreateInstance(GetType(System.Int32), 10)?

Imports System
Imports System.Data
Imports System.Collections

public class MainClass
   Shared Sub Main()
        Dim c()() As Integer = {New Integer() {1, 2}, New Integer() {1, 2, 3}}

        c(1) = New Integer() {4, 5}
        Console.WriteLine(c(1)(1))
        c(1) = System.Array.CreateInstance(GetType(System.Int32), 10)
        Console.WriteLine(c(1)(1))
        Dim d() As Integer = {6, 7}
        c(1) = d
        Console.WriteLine(c(1)(1))
   End Sub
End Class

推荐答案

文档会轻轻提供您需要的所有答案:Array.CreateInstance方法(类型,Int32) [ ^ ]。
All the answers you need are gently provided by the documentation: Array.CreateInstance Method (Type, Int32)[^].


这篇关于关于锯齿状阵列。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆