471,052 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,052 software developers and data experts.

how to create huge arrays in c/c++

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"command?
any other methods without using pointers is recommended.
Thanking you;
Vipin
Jul 9 '06 #1
1 2034
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"command?
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

Post your reply

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

Similar topics

10 posts views Thread by Fabian | last post: by
4 posts views Thread by RubenDV | last post: by
6 posts views Thread by Michael Gray | last post: by
8 posts views Thread by luke.yolanda | last post: by
reply views Thread by leo001 | last post: by

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.