Locked lesson.
About this lesson
In this lesson, we examine how to create and use Two Dimensional Arrays.
Exercise files
Download this lesson’s related exercise files.
26 - Two Dimensional Arrays.docx61.1 KB 26 - Two Dimensional Arrays SOLUTION.docx
58.4 KB
Quick reference
Two Dimensional Arrays
A Two Dimensional Array is an Array with another Array inside of it.
When to use
Use as needed.
Instructions
string[,] names = new string[2,3] {
{"John", "Tim", "Bob"},
{"Tina", "Erin", "Mary"}
};
names[0, 1]; // returns Tim
names[1, 2]; // returns Mary
Hints & tips
- Arrays can have other arrays in them!
- You can have as many dimensions as you like.
Lesson notes are only available for subscribers.