delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/09/16:55:31

From: perryr8461 AT my-deja DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: array-problem
Date: Wed, 09 Jun 1999 19:13:42 GMT
Organization: Deja.com - Share what you know. Learn what you don't.
Lines: 37
Message-ID: <7jmecs$sbl$1@nnrp1.deja.com>
NNTP-Posting-Host: 193.189.228.17
X-Article-Creation-Date: Wed Jun 09 19:13:42 1999 GMT
X-Http-User-Agent: Mozilla/4.03 [de] (Win95; I)
X-Http-Proxy: 1.0 proxy4.cityweb.de:8080 (Squid/2.2.STABLE2), 1.0 bigproxy2.cityweb.de:8080 (Squid/2.2.STABLE3), 1.0 x27.deja.com:80 (Squid/1.1.22) for client 62.52.155.151, 145.228.247.91, 193.189.228.17
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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?


Greetings,
David



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

- Raw text -


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