以下数组错误 [英] error with following arrays

查看:63
本文介绍了以下数组错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

long a [100000] [100000];
由于数组大小太大而出现错误.
我该如何消除此错误

解决方案

在您发布的其他问题中回答这些问题时,您打算发布这些问题多少次.返回并先阅读其他问题的答案.(我想要可以存储1000000个整数的2D数组 [删除此程序中的简单错误或警告请 [ ^ ],您说过需要使用malloc().现在,您正在显示一个简单的数组声明.是什么?


为什么需要这么大的数组来存储日期?它会占用大量RAM,因此程序很难正常工作.

长:8个字节.
100,000个long数组:800,000字节(加上开销)
100,000个数组(100,000个长数组):80,000,000,000字节(加上更多的额外开销)

一次分配或使用80 GB的阵列相当多.我强烈建议您重新设计系统,因为除非您的PC上安装了85GB或更多的RAM,否则使用起来会非常缓慢.


long a[100000][100000];
getting error as array size is too large.
how can i remove this error

解决方案

How many times are you guys going to post these questions when they are being answered in other questions you''ve posted. Go back and read the answer to your other questions first.(I want 2D array that can store 1000000 integers[^])

Also, in your question remove a simple error or warning in this program please[^] you said you needed to use malloc(). Now you''re showing a simple array declaration. Which is it?


why do you need such a big array to store your date?It will occupy a lot of RAM,so it is hard for the program to work normally。


long: 8 bytes.
array of 100,000 longs: 800,000 bytes (plus overhead)
array of 100,000 arrays of 100,000 longs: 80,000,000,000 bytes (plus lots more overhead)

80 GB of array is rather a lot to assign or use at a single time. I strongly suggest that you redesign your system, because it would be unworkably slow to use unless you have 85GB of RAM or more installed in your PC...


这篇关于以下数组错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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