user347640 user347640 - 1 year ago 67
C# Question

C# I'm getting an error

double dval = 1;

for (int i = 0; i < Cols; i++)
k = 0;
dval = 1;
for (int j = Cols - 1; j >= 0; j--)
colIndex = (i + j) % 3;
val *= dval[colIndex, k];
det -= dval;

I'm getting the error:

Cannot apply indexing with [] to an expression of type 'double' for dval

Help me, it is urgent!

Answer Source

dval is not an array, so you cannot use it in that way. you should have

double [,] dval = new double[rows, cols];

somewhere in your code, to define the matrix you are trying to use, and then you must have put some data in it.

Which kind of calculation are you trying to do?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download