Citat:
ZokiR:
U c#, foreach se koristi samo za kolekcije koje implementiraju IEnumerable interfejs ili ako deklarišu GetEnumerator metod.
Isto važi i za VB.NET. Postoji i COM verzija IEnumerable i COM platform invoke uvek za COM kolekcije implementira .NET IEnumerable, pa su COM kolekcije dostupne kao takve u .NETu. MIslim da se ovde krije nešto drugo.
BTW, mali input, čak i MS preporučuje sa strane optimizacije da se ne koristi foreach, pošto je sporiji od for(x=0;x<Count;x++)
▪ "Why isn't my wireless mouse connected to the computer?" - 2008 Dumbest Technical Support Question award
▪ The word 'politics' is derived from the word 'poly', meaning 'many', and the word 'ticks', meaning 'blood sucking parasites' - Larry Hardiman
▪ If the good guy gets the girl, it's rated PG; if the bad guy gets the girl, it's rated R; and if everybody gets the girl, it's rated X