Answers for "IndexOutOfRangeException in c#"

C#
2

IndexOutOfRangeException in c#

int[] test = new int[3];
    void Start()
    {
        test[1] = 5;
        test[2] = 12;
        test[3] = 7;/*this wil cause an errror
        becase it has an size of 3, but the
        array index starts with [0], so you
        have to write test[0],test[1] and
        test[2]*/
    }
Posted by: Guest on December-31-2020

C# Answers by Framework

Browse Popular Code Answers by Language