System.IndexOutOfRangeException

BugDict/C#

[C#] "System.IndexOutOfRangeException" 해결

문제상황: 다음의 코드는 사용자가 입력한 숫자들을 담은 리스트에서 홀수를 찾아서 다른 리스트에 추가하는 코드입니다. 그러나 코드를 실행하면 에러가 발생합니다. using System; using System.Collections.Generic; class Program { static void Main() { List numbers = new List() { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; List oddNumbers = new List(); for (int i = 0; i

Bug Detector
'System.IndexOutOfRangeException' 태그의 글 목록