che mcneil

che mcneil

  • NA
  • 5
  • 1.3k

INTERFACE Enumerable Enumerator

Nov 20 2018 11:05 AM
am newbie to programming gets this error expecting a variable
 
why?? Can someone show me the proper way to do this thank you!
 
CODE
 
public class EnumerableEnumerator : IEnumerable, IEnumerator
{
public string[] _people;
public string Currents;
int position = -1;
IEnumerator IEnumerable.GetEnumerator()
{
return (EnumerableEnumerator).GetEnumerator();
}
public bool MoveNext()
{
position++;
return (position < _people.Length);
}
public void Reset()
{
position = -1;
}
object IEnumerator.Current
{
get
{
return Currents;
}
}
}

Answers (1)