I have a structure with some values strucPos [] poss;
I need to change it, so I create the same structure structPos[] strpos = poss;
and make some changes with it. Then I try to copy strpos to poss, but have an error : object reference not set to an instance of an object.
poss = null;
while (l < strpos.Length)
{
if (strpos[l].use != "-")
{
poss[poss.Length - 1].count = strpos[poss.Length - 1].count;
poss[poss.Length - 1].ei = strpos[poss.Length - 1].ei;
poss[poss.Length - 1].id_r = strpos[poss.Length - 1].id_r;
poss[poss.Length - 1].nm_p = strpos[poss.Length - 1].nm_p;
}
l++;
}
As far as I understand it is because poss
is null. How should I change my code?