Martin877
Martin877

Reputation: 273

Pass N-dimensional array as parameter

I have n-dimensional array which I am creating by using:

var arrayND = Array.CreateInstance(typeof(int), sqs.Select(n => n.Count).ToArray());

I don't know the number of dimensions at compile time. Is there a way to pass the array as a parameter when I don't know the number of dimensions? Thanks.

Upvotes: 0

Views: 287

Answers (1)

Kapol
Kapol

Reputation: 6463

The System.Array class is the base class for all arrays in the CLR. You can pass it as your parameter.

Upvotes: 2

Related Questions