infinit range loop c#

43

infinit range loop c# -

public IEnumerable<int> InfiniteCounter()
{
    int counter = 0;
    while (true)
    {
        unchecked
        {
            yield return counter;
            counter++;
        }
    }
}

Comments

Submit
0 Comments