I have a C# method to convert from a list into an array. The code goes like this:
public String[] ConvertToArray(List<InstallationControl> list)
{
String[] Array = null;
Int32 i = 0;
foreach (var item in list)
{
Array[i] = item.Value.ToString();
i++;
}
return Array;
}
However, it's always giving me the Null exception. Can someone explain this to me?