delorie.com/archives/browse.cgi | search |
Xref: | news2.mv.net comp.os.msdos.djgpp:8425 |
From: | Paul Shirley <Paul AT chocolat DOT foobar DOT co DOT uk> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Declaring global arrays in a multisource project |
Date: | Sun, 8 Sep 1996 17:53:31 +0100 |
Organization: | DrinkSoft |
Lines: | 20 |
Distribution: | world |
Message-ID: | <WfqhlBALovMyEwiq@chocolat.foobar.co.uk> |
References: | <01I937U2638O00D67E AT cc DOT uab DOT es> <50ou0o$btf AT status DOT gen DOT nz> |
NNTP-Posting-Host: | chocolat.foobar.co.uk |
Mime-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
In article <50ou0o$btf AT status DOT gen DOT nz>, Bruce Foley <brucef AT central DOT co DOT nz> writes >I'd use this one: >> extern char my_global_array[256]; > > >> extern char *my_global_array; >> extern char my_global_array[]; > > >Also, use a #define for the array size so that if you decide to change >it, you only have to do it in one place. Remember, the only reason (in this case) for supplying the array size is to allow sizeof to work, so either import the size as a #defined symbol OR don't supply a size at all (so the compiler can trap use of sizeof). -- Paul Shirley
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |