我是C#的新手,想帮助我解决null引用异常,该怎么办?
Grade[] g1 = new Grade[10];// programming
Grade[] g2 = new Grade[10];
Grade[] g3 = new Grade[10];
Grade[] g4 = new Grade[10];
Grade[] g5 = new Grade[10];
// enter grades for students
for (int i = 0; i < s.Length; i++)
{
// course 1
Console.Write Line("Course : Programing of student\t:" + s[i]. First Name);
Console.Write Line("Enter attendance mark:");
g1[i]. Attendance = Convert.To Double(Console.Read Line());
//在这里,我例外了