Hi, Silly question from a new C programmer... I get a segmentation fault in the following code:

#include <stdio.h>
int main(void)
{
double YRaw[4000000]={0};
return 0;
}

Using GDB, I get the following comment:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5dd7b148
0x0000000100000f24 in main () at talk2me.c:18
18 double YRaw[4000000]={0}; // set YRaw[memdepth] so index is 0 to memdepth-1

Everything works find if I reduce the size of the YRaw array by a factor of 10. I have 6GB of RAM in the system, so why do I get an error? Thanks, Gkk