.Net数组的LongLength的目的是什么? [英] What is the purpose of LongLength for .Net Arrays?

查看:70
本文介绍了.Net数组的LongLength的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET中数组的LongLength属性的用途是什么.使用标准整数作为长度,您最多可以容纳20亿个索引.真的有人使用.Net来维护包含20亿个元素中的更多元素的单个数组.即使每个元素都是一个字节,也仍然是2 GB的数据.在.Net中使用如此大的数组是否可行?

What is the purpose of the LongLength property for arrays in .Net. Using a standard integer for length, you could accommodate up to 2 billion indices. Are there really people using .Net to maintain a single array with more the 2 billion elements. Even if each element was a single byte, that would still be 2 GB of data. Is it feasible to use such a large array in .Net?

推荐答案

此外,它还会返回 all 数组维度中元素的总数.一个只有十亿"个元素和4个维的数组,使其必须为64位int.

Plus it returns the total number of elements in all the dimensions of the Array so it can be an array with "just" a half billion elements and 4 dimensions to make it needed to be 64-bit int.

这篇关于.Net数组的LongLength的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆