错误1错误C2148:数组的总大小不得超过字节为0x7FFFFFFF我用C得到此Erorr [英] Error 1 error C2148: total size of array must not exceed 0x7fffffff bytes I get this Erorr in C

查看:4118
本文介绍了错误1错误C2148:数组的总大小不得超过字节为0x7FFFFFFF我用C得到此Erorr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个的char [1 048 576] [16 384] [1024] INT [1 048 576] [16 384] ,但我得到一个错误!

I want to make a char[1 048 576][16 384][1024] and a int [1 048 576][16 384] but i get an Error!

我想打一个三维数组一样大的Excel可以处理!

I want to make an 3d array as big as excel can handle!

感谢您的帮助!

推荐答案

使C中的数组,你需要使用malloc分配一些内存,无论是静态或动态。
在任何情况下,阵列将被物理计算机中映射像在RAM中。所以,你需要有足够的物理地点制造了。

to "make" an array in C you need to allocate some memory, either statically or dynamically with malloc. In any case, the array will be mapped physically in your computer like in the RAM. So you need to have enough physical place to "make" it.

在你的情况,你想大小的字符数组:
1048576 * 16384 * 1024 * sizeof的(焦)= 1048576×16384兆字节用char的大小是1个字节。

In your case, you want a char array of size: 1048576*16384*1024*sizeof(char) = 1048576*16384 MByte with char size is 1 byte.

这仅仅是太多了。
你的错误是有关的。
它告诉你,你可以请求的最大大小是一个有符号整数的最大数量。
请参阅:什么是一个INT32的最大值
这是根据要分配什么样的方式。

That is just too much. The error you get is related to that. It tells you that the maximum size you can request is the max number for a signed integer. See: What is the maximum value for a int32?. which is way under what you want to allocate.

如果你在Excel中,这些细胞都是空的,没有记忆保留给他们,直到他们都充满。

If you look at excel, the cells are all empty and no memory is reserved for them until they are filled.

这篇关于错误1错误C2148:数组的总大小不得超过字节为0x7FFFFFFF我用C得到此Erorr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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