private void Abc()
{
string first="";
ArrayList result = new ArrayList();
ArrayList secResult = new ArrayList();
foreach (string second in result)
{
if (first != null)
{
foreach (string third in secResult)
{
string target;
}
}
string target;
}
}
I cannot understand: why I cannot declare a variable outside the loop foreach, since the compiler gives an error that the variable is already declared. The scope of the variable foreach(and therefore target) is completed, where I declare this new variable.
source
share