c# foreach 원리
![[C#] 열거자 (Enumerator)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FkUZt8%2FbtqDJe1ryrS%2FAAAAAAAAAAAAAAAAAAAAAMS8_xyFYSx7eTRFg26099H2V6yVb7oGbYBDBIavBfyB%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DQdOC6dspMKWgyzz5k0o7w%252Br8jJw%253D)
[C#] 열거자 (Enumerator)
1. 문제 using System; using System.Collections.Generic; class Program { static void Main() { int[] arr = {1, 2, 3, 4, 5}; List c1 = new List(arr); for(int i=0; i < c1.Count; i++) { Console.WriteLine(c1[i]); } } } //----------------------------------------------------- using System; using System.Collections.Generic; class Program { static void Main() { int[] arr = {1, 2, 3, 4, 5}; LinkedList c1 = n..