开发者

Array Length/LongLength in .NET [duplicate]

开发者 https://www.devze.com 2023-02-17 20:16 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: What is the maximum length of an array in .NET on 64-bit Wind开发者_开发技巧ows
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

What is the maximum length of an array in .NET on 64-bit Wind开发者_开发技巧ows

What is the exact maximum theoretical size of an array on a x86 platform in .NET? Is is given by Int32.MaxValue or UInt32.MaxValue?


In theory it's 2,147,483,647 item (ie 2GB) at it uses an int. However, given that an array is a contiguous block of memory of memory and a process can only have 2GB of userspace you'll never actually be able to populate an array of this size as your userspace will have code and other app data in it which will reduce space available.


It is determined by the value of Int32.MaxValue

0

精彩评论

暂无评论...
验证码 换一张
取 消