Working with object

consider the variable ob4 as shown in figurevariable ob4

now : how can i reach ob4[0]->[0,2]

var o=ob4[0];
double[,] p=(double[,]) o[0,0];

the line (double[,] p=(double[,]) o[0,0];) gives the following error :
Cannot apply indexing with [] to an expression of type 'object'

Jon Skeet
people
quotationmark

You need to cast o[0, 0] to object[,] first:

var o = (object[,]) ob4[0];
double[,] p = (double[,]) o[0, 0];

It would be better if you could avoid having all these nested multi-dimensional arrays with so little type information at compile-time though - you haven't given us much context, but if you could change your object model, it would help a lot.

people

See more on this question at Stackoverflow