Possible Duplicate:
C programming, why does this large array declaration produce a segmentation fault?
I have written a simple program.
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
int genotype[150000000];
}
But I get a strange error:
RUN FAILED (exit value 1, total time: 131ms)
How can I save this amount of int?
(I have enough memory to save this amount of ints and my computer is 64-bit)
Your stack is too small. Put this on the heap, using new:
And i hope that following will be useful.
Or you can use limit.h to find out around what your program relies on.
For example, this is how you will find maximum range for int:
C:
C++