limit on array size

Jun 19, 2008 at 11:54am
hi,
i m writing a program to analyse some data.....i need to declare an array of size ~10^6-10^7...right nw i m unable to work with an array of size greater than 10^5..

please tell me how to declare arrays of such large sizes....

regards,
ajinkya.
Jun 19, 2008 at 12:04pm
i m not having problem with arrays of type "float"...
but problem is there with arrays of "uchar" type
Jun 19, 2008 at 1:00pm
You cannot declare an array larger than the system page file/memory segment size.

Are you using C++? Use a deque instead.
Stuck with C? You are going to have to break that array up into smaller, dynamically-allocated chunks.

Good luck!
Jun 19, 2008 at 1:13pm
Yes , i m using C++....
can u give me some tips on using deque

plz..
Jun 19, 2008 at 7:05pm
Have a look at this to get you started

http://www.cplusplus.com/reference/stl/deque/
Jun 20, 2008 at 10:27am
I read on one of the forums that declaring array as :

static unsigned uchar

will work....i tried it but the compiler is showing an error ...
actually i m extracting the data from a .root file....

can this static work in this case??
Jun 20, 2008 at 10:27am
sorry it's

static unsigned char

Jun 20, 2008 at 10:37pm
you double posted twice...try to minimize that :P
Topic archived. No new replies allowed.