public Grid (int width, int height, char defaultCharacter) {
for (int n = 0; n <= height; n++) {
List<char> aRow;
for (int i = 0; i <= width; i++) {
aRow.Add(defaultCharacter);
}
this.grid.Add(aRow);
}
}
This is some of my code. When I run this on Xamarin Studio it gives me an error on these lines saying "Use of unassigned local variable 'aRow'":
aRow.Add(defaultCharacter);
this.grid.Add(aRow);
This function is in a class called Grid, with one variable:
List<List<char>> grid = new List<List<char>>();
Any ideas on why this variable is unassigned?