Get its enumerator for an array : Array IEnumerator : Data Structure C# Examples


C# Examples » Data Structure » Array IEnumerator »

 

Get its enumerator for an array









    
using  System;
using  System.Collections;

class  MainClass
{
      static  void  Main()
      {
            int[]  intArray  =  {  10,  11,  12,  13  };                  

            IEnumerator  ie  =  intArray.GetEnumerator();      
            while  (ie.MoveNext()  ==  true)                              
            {
                  int  i  =  (int)ie.Current;                                  
                  Console.WriteLine("{0}",  i);                          
            }
      }
}
    
   
  
   



Output

10
11
12
13


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array IEnumerator