I believe this is what people refer to as stack overflow. Take a look at
allocating the memory with something like malloc, i.e.,
int *i = (int *) malloc(N * sizeof(int));
Blake Huff
stangmechanic@gmail.com
"I'd like to take this opportunity to thank my cat for letting me live
here."
On Dec 3, 2006, at 12:56 PM, Digvijoy Chatterjee wrote:
Hi ,
I was trying to test algorithms with huge int arrays when i started
getting segfaults..here is a simple program which emulates this
behaviour...
Each time i run this program , it segfaults , This might be very naive
..but can anyone help me with what I am missing here ?
static const int N=10000000;
int main()
{
int c, i[N];
for (c=0;c<N ; c++ )
i[c]=c;
}
Thanks
Digz