W
web1110
This code
public void ReturnArray(out string[] strArray)
{
string[] theArray=new string[]{"aaa", "bbb", "ccc"};
try
{
strArray=theArray;
}
catch
{
}
}
produces the syntax error.
The out parameter 'strArray' must be assigned to before control leaves
the current method
Why does this happen? Because of the possibility the assignment can fail in
the try block?
public void ReturnArray(out string[] strArray)
{
string[] theArray=new string[]{"aaa", "bbb", "ccc"};
try
{
strArray=theArray;
}
catch
{
}
}
produces the syntax error.
The out parameter 'strArray' must be assigned to before control leaves
the current method
Why does this happen? Because of the possibility the assignment can fail in
the try block?