I have a jagged array declared as:
char[][] m = new char[10][];
Later it is populated.
System.Text.StringBuilder s = new System.Text.StringBuilder(c);
for (int x = 0; x < 10; x++)
s.Append('=');
for (int x = 0; x < 10; x++) m[x] = s.ToString().ToCharArray();
If I perform the below operations, I get an error on the second dimension:
Console.WriteLine(String.Format("width={0}", m.GetLength(0)));
Console.WriteLine(String.Format("height={0}", m.GetLength(1))); <---- ERROR HERE
Any ideas?
char[,] maz). Each sub array is going to have a different length. that you check withmaz[index].Length.GetLenght(), ratherLengthof individual item of first array.