R
RayLopez99
Why? Why is the commented out first line below improper? The
overabundance of caution is the only thing I can figure. Not a big
deal, but strictly speaking unnecessary as the program should work
with this error.
RL
// char[] myCharacterArray; //gives: error CS0165: Use of unassigned
local variable
char[] myCharacterArray = new char[3]; //you must instantiate to avoid
this error
try
{
//do stuff here like...
char[] myCharacterArray = new char[3];
}
catch (Exception myexception)
{
}
foreach (char c in myCharacterArray)
{
Debug.WriteLine(c.ToString());
}
overabundance of caution is the only thing I can figure. Not a big
deal, but strictly speaking unnecessary as the program should work
with this error.
RL
// char[] myCharacterArray; //gives: error CS0165: Use of unassigned
local variable
char[] myCharacterArray = new char[3]; //you must instantiate to avoid
this error
try
{
//do stuff here like...
char[] myCharacterArray = new char[3];
}
catch (Exception myexception)
{
}
foreach (char c in myCharacterArray)
{
Debug.WriteLine(c.ToString());
}