for (int k = i + 1; k < 60; k++) { float f = a[k, i] / a[i, i]; for (int j = i + 1; j < 60; j++) a[k, j] = a[k, j] - a[i, j] * f; z[k] = z[k] - z[i] * f; } 

Here is the code. It shows an error on the cells of the arrays a and z: float f = a [k, i] / a [i, i]; It seems like the type float can be divided into type float. Right? Both arrays of this type. What to do to get rid of the error?

Closed due to the fact that off-topic participants Che , Cheg , andreymal , insolor , br3t 16 Sep '17 at 22:07 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - ߊߚߤߘ, Cheg, andreymal, insolor, br3t
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • this is not a c ++ syntax float f = a [k, i] / a [i, i] is not a two-dimensional array. stackoverflow.com/questions/29933444/… Show all code and screen with error. - Valera Kvip
  • Lord How stupid I am. I have no forgiveness. Thanks for poking your face! :) - PavelKas

1 answer 1

This is not the c ++ syntax float f = a [k, i] / a [i, i] and this is not a two-dimensional array. https://stackoverflow.com/questions/29933444/c-multi-dimensional-array-comma-index-address

It will work this way if there are no errors outside that part of the code you gave

 for (int k = i + 1; k < 60; k++) { float f = a[k][i] / a[i][i]; for (int j = i + 1; j < 60; j++) a[k][j] = a[k][j] - a[i][j] * f; z[k] = z[k] - z[i] * f; }