The solution to this is most undoubtedly obvious, but I can't seem to
figure it out...your help is appreciated.
Let's say I have a block of code that looks like this:
string[] array1;
int i =0;
try
{
array1= new string[10];
while (i <10)
{
array1[i] = i;
i++;
}
}
catch
{
bool result = VerifyArray(array1);
}
When compiling, I get use of unassigned local variable on the catch
statement for array1.
As you can see, however, my array gets assigned inside of the try block.
If I try to initialize array1 to null when I declare it, assigning
values to it errors out.
Any ideas?