Did you define it as a local variable?
All local variables are placed in the stack, which size is not infinite!
Try to redefine it as a global variable, i.e. outside of any function.
Or better use dynamic memory allocation with operator "new" or function like old "malloc".
That is a big array!
What is it an array of? If it is an array of int, 2 bytes per int, thats 1000 * 1000 * 1000 * 2 bytes of memory.
Does your machine have > 2Gig of ram?
Try a smaller array, if that works, the problem is size!
:?
That is a big array!
What is it an array of? If it is an array of int, 2 bytes per int, thats 1000 * 1000 * 1000 * 2 bytes of memory.
Does your machine have > 2Gig of ram?
Try a smaller array, if that works, the problem is size!
:?
Why RAM? It is virtual memory! So, your data will reside not only in physical RAM, but also in the swap file on the disk. For example, my system has 512 Mbytes of physical RAM, but I can easy create data structures with the size of 1 Gbyte or more. The maximum size depends only on available space for the swap file and on the maximum address space for one process in the OS.
then you have a class by possition in the three dimentional array
you can also define arrays
using c stuctures
like
x=1000
y=1000
z=1000
variable_name[x]
variable_name[y]
variable_name[z]
int p=3
p= (x+y+z) + (-x-y-z)
p is then an origin of xyz
or you can do it in bytes
these same maths can be used by
the guy looking for dsp for coding a mux
for stereo fm
if you read the maths are L&R = ( (L+R) - (R-L) )
1024 is a close derivative
so three time 1024
so too do this
you code the array in three 8 bit words
or ask fred http://www.fredosaurus.com/notes-cpp/
look at texts arrays of arrays {multidimentional arrays}
1. Try redesign your algorithm so it does not use 2GB for an array of data.
2. Alternatively, you can place data array in a file and operate on it. It will be damn slow, but it will work (assuming that there is at least 2 GB of free space on HD).