foreach (var (counter, _, _) in Count())
{
... // do stuff with counter
}
return counter;
counter
's out of scope after the foreach
so the above doesn't work.
How can I use one of the iteration variables after a loop other than
int latestCounter;
foreach (var (counter, _, _) in Count())
{
... // do stuff with counter
latestCounter = counter;
}
return latestCounter;