Because num1
in a single int
, not an array. Do you mean:
{
int num1 = backData[num4, num3 + num2, 0];
num1 += leftData[num4 + num, num3, 0];
}
However I suspect that that you are expecting num1
to be a reference to the array location you calculate in the first line. If that is the case just assign it directly:
backData[num4, num3 + num2, 0] += leftData[num4 + num, num3, 0];
solved I have got an error while assigning value to int from an array [closed]