I’m getting compilation error “Wrong number of indices insice [] : expected 1”. But why? I think I’m not doing anything strange.
Here is the code (inside one function):
// **valoresMonedas is a Int32[] array passed as parameter**
Int32[] valores = valoresMonedas;
Int32[][] matrixnN;
Int32 valMon = valoresMonedas.Count();
matrixnN = new Int32[valMon][];
for (Int32 i=0;i< cantidadTotal;i++){
// **cantidadTotal is a Int32 passed as parameter**
matrixnN[i] = new Int32[cantidadTotal];
}
for (Int32 i=0;i< valMon; i++){
matrixnN[i][0] = 0;
}
// some code... (just if / for / assignations ..)
matrixnN[0][1] = 1 + matrixnN[1, 1 + valores[1]]; // <-- THE ERROR IS HERE
Thank you for any suggestion
I guess
matrixnN[1, 1 + valores[1]]should bematrixnN[1][1 + valores[1]]