Date: Wed, 8 Oct 1997 11:08:04 +0200 (IST) From: Eli Zaretskii To: Peter Berdeklis cc: djgpp AT delorie DOT com Subject: Re: [Q] array declaration In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 7 Oct 1997, Peter Berdeklis wrote: > Put the extern declaration in a header file, which is included by any > file which references the array, including the file that allocates the > array. I think this won't solve Victor's problem, because you still have to declare the array in two different places. One place is the header file you are suggesting, where it should be declared extern: extern char array[280]; The other place is that single source file which has to *define* the array (so it gets allocated some space): char array[280]; Some programs also need to initialize the array, so they'll need to say something like so: char array[280] = {1, 2, 3, 4}; But anyway, you need at least two different declarations. I think that saying "extern char array[];", e.g. in the header suggested by you, is a better solution, since you don't need to mention the dimension twice. There are other solutions, but none of them is elegant. This happens to be one of the ugliest problems in C.