如何修复 C# 锯齿状数组类型转换错误

How to fix C# Jagged arrays Type Conversion Error

本文来自微软在edx上的C#数据结构与算法课程

"锯齿状数组 交错数组只是数组的数组,每个数组的大小可以变化。"

int[][] jaggedArray = new int[10][];

jaggedArray[0] = new Type[5];//cannot implicitly convert type 'system.Type[]' to 'int[]'

jaggedArray[1] = new Type[7];//cannot implicitly convert type 'system.Type[]' to 'int[]'

jaggedArray[9] = new Type[21];//cannot implicitly convert type 'system.Type[]' to 'int[]'

预期结果:没有错误

实际结果:无法将类型 'system.Type[]' 隐式转换为 'int[]'

请帮忙

更新: 我是 C# 新手,我认为课程中有错误:https://courses.edx.org/courses/course-v1:Microsoft+DEV204.3x+1T2019/courseware/3544566571fe4074b46541d73149ad8d/c97ee813019947a0b2ba0dfb1f60b132/1?activate_block_id=block-v1%3AMicrosoft%2BDEV204.3x%2B1T2019%2Btype%40vertical%2Bblock%4008d10138ab7542969703766ee6eb1b03

我会报到课程

感谢您的评论和回答。他们有帮助。

正如评论所说,System.Type 与 int 不同,我想你想要这样的东西:

Type[][] jaggedArray = new Type[10][];
jaggedArray[0] = new Type[5];
jaggedArray[1] = new Type[7];
jaggedArray[9] = new Type[21];