From: Paul Shirley Newsgroups: comp.os.msdos.djgpp Subject: Re: [Q] array declaration Date: Sat, 11 Oct 1997 13:53:43 +0100 Organization: wot? me? Distribution: world Message-ID: References: Reply-To: Paul Shirley NNTP-Posting-Host: chocolat.foobar.co.uk Mime-Version: 1.0 Lines: 23 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article , Eli Zaretskii writes >There are other solutions, but none of them is elegant. This happens >to be one of the ugliest problems in C. The 'elegant' solution is to #define the array size in a header (the same one you declare the array seems a good idea;) then use it in both the declaration and definition of the array. so.. #define MYSIZE (280) extern char myarray[MSYIZE]; ...later... #include char myarray[MYSIZE]; This guarantees that all references to myarray see the same sized array. (And makes sure that make will keep all uses in sync as a bonus.) --- Paul Shirley: my email address is 'obvious'ly anti-spammed