From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: [Q] array declaration Date: Mon, 13 Oct 1997 19:49:28 -0700 Organization: Alcyone Systems Lines: 26 Message-ID: <3442DDB8.6CC7673E@alcyone.com> References: NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Eli Zaretskii wrote: > This solves the problem with the size, but it still requires you to > put the type of the variable in two different places. What if one day > you decide to make `myarray' int or long or an array of structs? But how is this model any different than for functions? If you want to change the parameters or return type for a function, you have to change it in the function definition as well as its declaration (i.e., prototype). Same thing with externals. If you want to change the definition, you have to change the "prototype" -- that is, the declaration. > You put this into a header, then in one, and only one, source file > say "#define DEFINE_VARS". This is ugly, but it works. Agh. This is like patching a tiny little hole by blowing up the dam. -- Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com Alcyone Systems / http://newton.alcyone.com/ San Jose, California, United States / icbm://+37.20.07/-121.53.38 \ "After each war there is a little / less democracy to save." / Brooks Atkinson