By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,130 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,130 IT Pros & Developers. It's quick & easy.

how to create huge arrays in c/c++

P: 1
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
Share this Question
Share on Google+
1 Reply


P: 35
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.