Page 1 of 1
highest range of array
Posted: Mon Jul 23, 2007 10:28 am
by Mister X
plz tell me what are the highest ranges for different kinds of array to be taken in memory,
like for int, long, bool....and explain

Posted: Tue Jul 24, 2007 3:54 pm
by Mister X
why don't anyone reply?:(
i wanted to know what is the highest size of the array(int,long,bool,char type) can be declared in c++?
plz reply...
Posted: Tue Jul 24, 2007 4:10 pm
by mf
C++ itself doesn't place any restrictions on maximum size of arrays.
It depends on your hardware's architecture, compiler, OS, amount of physically available memory...
At this online judge, default memory limit for programs is 32Mb.
That's 33554432 bytes. Divide this number by the size of array's element to get the maximum size of array you can have.
Posted: Tue Jul 24, 2007 4:21 pm
by Mister X
thnx for your rply. suppose i am using visual c++ as compiler and my pc is 64bit and say i have enough available memory, then isn't there any limit?!!
any standard??
Posted: Tue Jul 24, 2007 4:24 pm
by mf
With 64-bits you're pretty much limited only by the amount of physically installed memory.
In fact, a 64-bit compiler should be able to compile programs with any array size, as long as total size of all arrays doesn't exceed about 2^64 bytes.
But you won't be able to load the program if you don't have enough memory.