Quote:
the error is unable to convert type int [] to int
what is wrong
Your approach is wrong: an array item (like
population[i,j]
) is a
scalar type (i.e. a single number in your case) while a whole array (like
array
) is a collection of scalar types (that is
array
contains many numbers). You cannot assign a collection to a single number.
The following line
population[i, j] = array[j];
would be syntactically correct (however it could be semantically wrong, it could produce a runtime error, etc...).
[Update]
You cannot do that with bidimensional arrays, you have to use jagged arrays, see, for instance:
"c# assign 1 dimensional array to 2 dimensional array syntax"[
^] at Stack Overflow.
[/Update]