c# IEnumerator
[C#] 코루틴 (COROUTINE) (2)
1. 핵심 정리 using System; using System.Collections; using System.Collections.Generic; class Node { public int data; public Node next; public Node(int d, Node n) { data = d; next = n; } } // 열거자 class IntLinkedListEnumerator : IEnumerator { public Node head = null; public Node current = null; public IntLinkedListEnumerator(Node n) { head = n; } public object Current => current.data; public bool Move..
[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..