delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/08/11:18:34

Date: Wed, 8 Oct 1997 17:17:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: [Q] array declaration
In-Reply-To: <Pine.SGI.3.91.971008094204.9747B-100000@atmosp.physics.utoronto.ca>
Message-ID: <Pine.SUN.3.91.971008171325.29380F-100000@is>
MIME-Version: 1.0

On Wed, 8 Oct 1997, Peter Berdeklis wrote:

> If you include the header file in the source file that defines the array, 
> then the compiler will complain about a redefinition of the array only if 
> the type or size of the array is different.  If the type and size of the 
> extern declaration and the definition are the same there will be no 
> complaint.

Maybe I misunderstood what was Victor's problem; if so, I apologize.

I thought Victor was asking how could he avoid putting that array
dimension in two different places.  If the dimension is only in one place,
he doesn't have to worry about two potentially different numbers.  So I
suggested to only use the actual dimension once. 

OTOH, your suggestion still requires to write the dimension twice, so the 
possibility of error still exists, even though the compiler might catch 
it.

- Raw text -


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