delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/07/11:02:32

Date: Tue, 7 Oct 1997 17:00:19 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Victor <fesenko AT pacific DOT net DOT sg>
cc: djgpp AT delorie DOT com
Subject: Re: [Q] array declaration
In-Reply-To: <61cskr$fh8$1@newton.pacific.net.sg>
Message-ID: <Pine.SUN.3.91.971007165850.26209B-100000@is>
MIME-Version: 1.0

On Tue, 7 Oct 1997, Victor wrote:

> When I declare an array like this
> int foo[260];
> and then somewhere in the separate file I again declare it as
> extern int foo[260];
> the size of array is not checked, so second time I could have declared
> it as [280] without a warning.
> 
> The question is how to declare the array so that it's possible to have
> it's size checked to prevent mistakes.

Why do you need the size be checked twice?  In the second file, just say 
this:

	extern int foo[];

That's it!

- Raw text -


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