From owner-freebsd-questions@FreeBSD.ORG Thu May 6 11:58:43 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9C2116A4CE for ; Thu, 6 May 2004 11:58:43 -0700 (PDT) Received: from hotmail.com (bay8-f110.bay8.hotmail.com [64.4.27.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FD9A43D41 for ; Thu, 6 May 2004 11:58:43 -0700 (PDT) (envelope-from ckorves@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 6 May 2004 11:58:43 -0700 Received: from 134.174.187.132 by by8fd.bay8.hotmail.msn.com with HTTP; Thu, 06 May 2004 18:58:43 GMT X-Originating-IP: [134.174.187.132] X-Originating-Email: [ckorves@hotmail.com] X-Sender: ckorves@hotmail.com From: "Caroline Korves" To: freebsd-questions@freebsd.org Date: Thu, 06 May 2004 14:58:43 -0400 Message-ID: X-OriginalArrivalTime: 06 May 2004 18:58:43.0487 (UTC) FILETIME=[26F742F0:01C4339C] MIME-Version: 1.0 Content-Type: text/plain X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: segmentation fault-- is my array too long? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2004 18:58:44 -0000 Hello, This short program below represents a problem I am having with segmentation faults in a much larger C program that has numerous arrays. Seems as though when I increase the number of elements in an array (here, for example, beyond 130,000) a seg fault occurs. Any idea on what I should change to make the program run with large numbers of elements in my arrays? Thanks. #include #include #include #define td 365 /* # days in trxn season */ #define lifetab 94 /* enter 94 lines from life table, corresponds to 27-120 years */ /* # persons in run */ #define persons 150000 #define scens 4 int main() { long int j, person=0; double ncost[persons][scens]; double nuts[persons][scens]; printf("check "); printf("\n"); for (person=0; person