Why did I get the compile error “Use of unassigned local variable”?
Local variables aren’t initialized. You have to manually initialize them. Members are initialized, for example: But local variables are not: So your code must be: So the long and the short of it is, members are initialized, locals are not. That is why you get the compiler error.