This is an exercise for this YouTube video.
Happy learning and good luck!
[qsm quiz=6]
Assignment: Make a 2D jagged array and a 2D multidimensional array with the exact same content using a collection initializer.
Click to see the answer
int[][] jagged = new int[][] { new int[] {1, 2, 3, 4}, new int[] { 5, 6, 7, 8} }; int[,] multidimensional = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 } };
Assignment: Print out the contents of both of the arrays from the previous assignment.
Click to see the answer
for (int i = 0; i < jagged.Length; i++) for (int j = 0; j < jagged[i].Length; j++) Console.WriteLine(jagged[i][j]); for (int i = 0; i < multidimensional.GetLength(0); i++) for (int j = 0; j < multidimensional.GetLength(1); j++) Console.WriteLine(multidimensional[i, j]);
I see you don’t monetize your site, don’t waste your traffic, you can earn additional cash every month because you’ve got high quality content.
If you want to know how to make extra $$$, search for: Boorfe’s tips best adsense alternative
im a student
i want to learn jagged array