What am I doing wrong? When using Eclipse on a Mac (2GB RAM), I ran into the following problem:
Whenever I try to create an array that exceeds 8384896 bytes, I get segmentation errors. The following program will be executed:
#include <stdio.h>
main()
{
double x[1048112];
printf("sizeof(x) = %li", sizeof(x));
}
and the output will be (as expected):
sizeof (x) = 8384896
But increasing the number of elements in x or creating additional variables in main () will lead to an unexecutable program and segfaults. Looks like I'm pushing some memory limit, and I don't understand why this is happening. I would be very grateful if someone could explain this to me, or maybe offer some solution to my problem.