Connecting Tech Pros Worldwide Forums | Help | Site Map

how to create huge arrays in c/c++

Newbie
 
Join Date: Jul 2006
Location: india
Posts: 1
#1: Jul 9 '06
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

Member
 
Join Date: Jul 2006
Posts: 35
#2: Jul 13 '06

re: how to create huge arrays in c/c++


Quote:

Originally Posted by vipinvarkey

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.
Reply