简体   繁体   中英

Array Type Declaration C#

I'm declaring an array of 16bit signed integers whose elements may run into the millions. I've been declaring the array as type Long as I was thinking along the terms of element length instead of the limit of each individual element. Is it correct to declare the type of array according to element types?

Thanks

The element type of an array has nothing to do with the type of the index.
C# arrays only support 32-bit int indexing.

You should use a short[] .

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