George George

George George

  • NA
  • 778
  • 0

foreach and IEnumerator

Apr 30 2008 6:00 AM

Hello everyone,


Two questions,

1.

How foreach utilizes the IEnumerator interface and IEnumerable interface? Any there any docuements? I am interested in it.

2.

Pros and cons compared with using foreach and using simple index variable to iterate? Like,

[Code]
for (int i = 0; i < abc.Count; i++)
{
    // access abc [i] here
}
[/Code]


thanks in advance,
George


Answers (4)