Why the SIGSEGV?

c, segmentation-fault

Solution

Use malloc() to get that much memory. You're overflowing the stack.

unsigned long *toshuffle = malloc(9765625 * sizeof(unsigned long));

Of course when you're done with it, you'll need to free() it.

NOTE: In C++, you need to cast the pointer to the correct type.

Problem

Why is this code throwing up a SIGSEGV: ``` int main() { unsigned long toshuffle[9765625]; unsigned long i; for (i=0; i< 1000; i++) toshuffle[i]= i; return 0; } ``` Pointers will be appreciated. (No Pun intended :))

Original source