Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!uwvax!uwmacc!jwp From: jwp@uwmacc.UUCP Newsgroups: comp.lang.c,comp.unix.questions Subject: Question on large arrays in C Message-ID: <1051@uwmacc.UUCP> Date: Wed, 11-Feb-87 19:46:15 EST Article-I.D.: uwmacc.1051 Posted: Wed Feb 11 19:46:15 1987 Date-Received: Thu, 12-Feb-87 20:29:59 EST Organization: UWisconsin-Madison Academic Comp Center Lines: 27 Keywords: C unix Xref: watmath comp.lang.c:998 comp.unix.questions:1003 I am running 4.3BSD on a MicroVax II. I have a simple program: ---------- #include #define N 20480 main() { double x[N]; double y_1[N]; double y_2[N]; double y_3[N]; double y_4[N]; char *l = ""; fprintf(stdout, "hi\n"); exit(0); } ---------- When I run it, I get "Segmentation violation". dbx reports the violation to occur on the "char *l" line. If I move the 5 array declarations up above main(), under the define statement, the program works OK. What is wrong with the program as listed above? -- Jeff Percival ...!uwvax!uwmacc!sal70!jwp or ...!uwmacc!jwp