简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM