Enumerates an array using an enumerator object : Array : Collections Data Structure C# Source Code


Custom Search

C# Source Code » Collections Data Structure » Array »

 

Enumerates an array using an enumerator object








    
 

using System;
using System.Collections;

public class Starter {
    public static void Main() {
        int[] numbers = { 1, 2, 3, 4, 5 };
        IEnumerator e = numbers.GetEnumerator();
        while (e.MoveNext()) {
            Console.WriteLine(e.Current);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Collections Data Structure
» Array