From: Uwe Sydow Newsgroups: comp.os.msdos.djgpp Subject: Problem with pointer(?) Date: Tue, 27 Jun 2000 15:01:23 +0200 Organization: =?iso-8859-1?Q?Universit=E4t?= Bremen Lines: 51 Message-ID: <3958A5A3.D470EC39@uni-bremen.de> NNTP-Posting-Host: caesar.chemie.uni-bremen.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, I like to calculate a gaussian distribution of numbers defined by mean and variance on a MAX x MAX grid. What I don't understand is, for some values of MAX (eg 100) the programm works, for eg MAX =10 it doesen't. What did I make wrong? Thanks a lot for help Uwe /* prog */ #include #include #include #include #define MAX 100 /* 100 is ok, but 10 or 11 crashes ?? */ int main(void) { double dd=4.0; /* mean */ double da=1.0; /* variance */ short Zh; int i,j; double (*tg)[MAX] = calloc(pow(MAX,2), sizeof(double)); double Z0,Z1,Z2,Z3; srand(time(0)); for (i=0;i=Z3 ) { tg[i][j]=Z1; Zh=1; } /* end if */ } /* while */ } /* for j */ } /* for i */ for (i=0;i