delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/09/17:51:58

Sender: nate AT cartsys DOT com
Message-ID: <375EE180.8474180A@cartsys.com>
Date: Wed, 09 Jun 1999 14:49:52 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: array-problem
References: <7jmecs$sbl$1 AT nnrp1 DOT deja DOT com>
Reply-To: djgpp AT delorie DOT com

perryr8461 AT my-deja DOT com wrote:
> 
> Hello,
> I have some problems with the following code:
> 
> ...
> main()
> {
>     int num_m, num_n,i,q;
>     int m[128][128];
>     printf ("m=");
>     scanf ("%d", &num_m);
>     printf ("n=");
>     scanf ("%d", &num_n);
>     for (i=0;i<num_m;++i)
>     {
>         printf ("\nm#%d\n", i+1);
>         for (q=0;q<num_n;++q)
>         {
>             printf ("n#%d=", q+1);
>             scanf ("%d", m[i][q]);
>         }
>     }
> }
> ...
> 
> When I compile it with TurboC and replace int m[128][128] with
> int m[16][16] it runs correctly. But when I compile it with DJGPP
> it aborts. I guess it has something to do with the array m. Does
> somebody know where the bug is?

See FAQ section 15.9.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019