2

I want an Array(not a list converted to an Array), to assign only 1 coordinate something like "A4" should be accessed like _excelCoordinate["A"][4], so I was thinking of a multidimensional array whith only one element(coordinate pair).

This is what I came up with:

private dynamic[,] _excelCoordinate;

_excelCoordinate = new[,] { { "" }, { 0 } };

But I get:

No best type found for implicitly-typed array

And maybe no extra class, for that data structure.

How should it look the correct way ?

0

1 Answer 1

1

You need to specify the type of the array you are creating (in this case dynamic[,]). The compiler cannot infer what the type of the array should be based on the elements (the string and the integer) provided in the array initializer.

_excelCoordinate  = new dynamic[,] { { "" }, { 0 } };
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.