I wish to know what this program is try to say.
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);
}
Console.Read();
}
}
/*
10
11
12
13
*/
Loading
Posted May 15, 2014, 8:25 AM
VulpesPosted May 14, 2014, 3:32 PM
Posted May 14, 2014, 2:48 PM
int i = (int)ie.Current;
Console.WriteLine("{0}", i);
with this
Console.WriteLine("{0} ", ie.Current);
Casting is not necessary. Please explain why?
Posted May 14, 2014, 10:23 AM
VulpesPosted May 14, 2014, 9:20 AM