www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/06/02:54:08

Xref: news2.mv.net comp.os.msdos.djgpp:8338
From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Declaring global arrays in a multisource project
Date: Thu, 05 Sep 1996 19:23:50 -0700
Organization: Alcyone Systems
Lines: 23
Message-ID: <322F8B36.80FAF1A@alcyone.com>
References: <01I937U2638O00D67E AT cc DOT uab DOT es> <322E35D9 DOT 5291 AT cs DOT com>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

John M. Aldrich wrote:

> You should always define extern variables in _exactly_ the same way you
> define them in the 'home' module.  Anything else could get you into trouble.

I believe you're guaranteed that 

    extern char my_global_array[];

will work in any case.  Someone else (Eli?  You're always good at catching my
mistakes) could probably verify this.

The external declaration 

    extern char *my_global_array;

however, definitely will _not_ work.  Pointers and arrays are similar, but
they are not the same thing, particularly when defined globally.

-- 
Erik Max Francis, &tSftDotIotE   http://www.alcyone.com/max/   max AT alcyone DOT com
San Jose, California   ICBM 37 20 07 N 121 53 38 W   R^4: the 4th R is respect
"Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_

- Raw text -


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