delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/21/22:39:13

Sender: nate AT cartsys DOT com
Message-ID: <376EF698.A70631D8@cartsys.com>
Date: Mon, 21 Jun 1999 19:36:08 -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: Question: allocation
References: <7km7cs$sc$1 AT nslave1 DOT tin DOT it>
Reply-To: djgpp AT delorie DOT com

Marco Fabiani wrote:
> 
> I've a little question:
> 
> i'f i declare:
> 
> int    a[10];
> int    b[10];
> 
> int    main()
> {
> int    c[10];
> int    d[10];
> 
>     /*    ecc.ecc.    */
>     return 0;
> }
> 
> where a, b, c, d goes?
> c and d should go on stack, that in Intel-based machines means c > d (c is
> allocated at an upper address than d), but a and b?? Does djgpp use a data
> segment for global variables (thus b > a) or system stack (thus a > b)?

Data segment, conceptually.

> And, is it safe to assume that a and b are allocated consecutively in
> memory?

No.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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