I am simply trying to write months to an array in a certain order.
string January = "January";
string February = "February";
string March = "March";
string April = "April";
string May = "May";
string June = "June";
string July = "July";
string August = "August";
string September = "September";
string October = "October";
string November = "November";
string December = "December";
and then writing to the array like so:
for (int i = 0; i < (janC - 1); i++)
{
analyser.sortedmonths[i] = January;
}
sortedmonths is initialized in another cs sheet. The sorted months array is 1022 in size as that is the amount of months being read in.
Why is this not working? I have googled the null reference exception but have not found anything related to writing to an array.