im getting this error of null reference
private int Cont;
private List<string> myStrings;
private ArrayList str;
private string[] strs;
myclass()
{
Cont = 0;
myStrings = new List<string>();
str = new ArrayList();
strs =new string[27];
for(int i = 0; i < 27;i++)
{
strs[i] = "";
}
}
public void AddTexture(string name)
{
Console.WriteLine("Count "+Cont);
Console.WriteLine("ive got the texture "+name);
myStrings.Add(name);
//strs[Cont] = name;
//str.Add(name);
Cont++;
}
as you see i've tried with list,arraylist and arrays and none of them work when i try to add the first value i get that error i have seriously no idea whats happening i am getting a string in name,and Cont = 0 in the 1st write line
any idea what im doing wrong? thank you the error is whenever im trying to fill the array,arraylist or the list in the function AddTexture after the 2 console.writeline i've commented those 2 lines but thats because those are the ways i tried to use the array,arraylist and the list