I am trying to make a list program but i did something wrong
It gives an array index error, can you tell me what i did wrong?



i is , its already 2 more than the last valid indexint i = list.Lengthstring[]List<string>string[] list = new string[max];[]maxmax - 1max + 1whilefori + 1 == maxint i = 0;
while (i < list.Length)
{
// do something
i++;
}for (int i = 0; i < list.Length; i++)
{
// do something
}