Question on large arrays in C

bright at dataio.UUCP bright at dataio.UUCP
Sat Feb 14 04:40:00 AEST 1987


In article <1051 at uwmacc.UUCP] jwp at uwmacc.UUCP (Jeffrey W Percival) writes:
]I am running 4.3BSD on a MicroVax II.
]I have a simple program:
]----------
]#include <stdio.h]
]#define N 20480
]main()
]{
]	double x[N];
]	double y_1[N];
]	double y_2[N];
]	double y_3[N];
]	double y_4[N];
]
]	fprintf(stdout, "hi\n");
]}
]----------
]When I run it, I get "Segmentation violation".
]What is wrong with the program as listed above?

You are using 5*8*20480 == 819200 bytes of stack, which is a bit much
for most machines...



More information about the Comp.lang.c mailing list