0

I want to know difference IEnumerator and IEnumerable. This is a question I got when I was using coroutine. what they have difference? And do they have different uses? It's the biggest question using C# and Unity, but it's hard to understand. I want to learn about that easily.

I found they difference, but I don't understand that's Description.

PMF
  • 14,535
  • 3
  • 23
  • 49
Kim Huisu
  • 3
  • 1
  • 1
    an eunmer*able* is - well iterable. You can iterate it. The enumerator is used to do that. – MakePeaceGreatAgain Dec 14 '22 at 15:36
  • IEnumerator is the enumerator itself, IEnumerable is an interface which allows you to return something. For example, System.Collections.Generic.List is IEnumerable, and returns an IEnumerator so you can use it in a for each. – SupaMaggie70 b Dec 14 '22 at 15:37

0 Answers0