Nullreferenceexception не обработано - C#
Формулировка задачи:
Имею такой вот код:
Объясните, пожалуйста, дурачку, как писать, чтобы было изменить значение null?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test3
{
public partial class Form1 : Form
{
class test3
{
public bool perem = new bool();
}
test3[] test2 = new test3[99];
public Form1()
{
InitializeComponent();
test2[0].perem =true;
}
}
}Решение задачи: «Nullreferenceexception не обработано»
textual
Листинг программы
for(int i = 0; i < test2.Length; i++) test2[i] = new test3();