473,789 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create huge arrays in c/c++

1 New Member
hello;
i need to create a very long array in c of the foll specification:
a[640][480]
however i get an error telling that the array's size is too large.the help file advices either to use malloc or huge
can anyone help me how to use "huge"comma nd?
any other methods without using pointers is recommended.
Thanking you;
Vipin
Jul 9 '06 #1
1 2153
Ashish_CPP
35 New Member
hello;
i need to create a very long array in c of the foll specification:
a[640][480]
however i get an error telling that the array's size is too large.the help file advices either to use malloc or huge
can anyone help me how to use "huge"comma nd?
any other methods without using pointers is recommended.
Thanking you;
Vipin

Hi,
I dont know on which platform you are working on becoz the array size that you have mentioned can be easily allocated on windows based C application. But using malloc is always a good programming teqnique because it utilizes the unused memory blocks. And if malloc is used then pointer is a must. I suggest you to use pointer, infact pointer will be more convinient than any other method.
Jul 13 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
7047
by: Fabian | last post by:
Are there any speed issues in javascript with having really large arrays? I know if the array gets large enough, bandwidth and download time can be an issue, but does it take inordinate amounts of time to access a really large array? -- -- Fabian Visit my website often and for long periods!
4
1834
by: RubenDV | last post by:
I am trying to make a cipher with a 256-bit key but i have no idea how the store this key without using arrays of ints or something like that. I just need a type that is big enough to hold the entire key, because i am going to use multiplication operations and such, which i can impossibly use on arrays or so i think. Is there a way to treat an array as a single, huge number without really being that? Any help is appreciated!
18
3171
by: zehanwang | last post by:
Compiler: Visual C++ 6.0 My code: //============================== # include "stdio.h" # include "stdlib.h" int main() { int v; long i; for (i=1; i<=10000000; i++) v =i;
1
2702
by: Reynardine | last post by:
I am calling a C/C++ DLL from C# and I am marshalling the parameters to the API call by doing a type conversion for each parameter. For example, here is my C++ API method : short int XENO_API XcDatabaseCodes ( HWND hwnd, char FAR * pszDatabase, char FAR * HUGE * FAR * pszItemCategories
6
3178
by: ad | last post by:
I have a huge sting array, there are about 1000 element in it. How can I divide the huge array into small ones, and there are one 10 elements in a small one array?
6
2465
by: Michael Gray | last post by:
VS 2003 VB.net Win2000 SP4 The System.Array class seems to be limited to 32 bit addresses, meaning that one can only assign 2^32 elements. Is there any way that I can have an array that allows 2^64 elements? Or doesn't the CLR support this on a 32 bit opsys? I suspect that I am going to have to make such a beastie myself...
8
2301
by: luke.yolanda | last post by:
is anyone know how to implement a huge 2-D array? such as ' unsigned char a; ' I compile and run it in VC 6.0, but it show me an error.... thank you guys
8
2013
by: sarega | last post by:
Hi, I have two very huge arrays, the second array contains some of the elements of array1 and also different elements, both are not of the same size, have to find only the elements that are not common in both the arrays, I used array_diff but its not working can some body help me with this?? Thanks in advance
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.