From: Stefan Hoehne Newsgroups: alt.comp.lang.learn.c-c++,comp.os.msdos.djgpp Subject: Re: Extern int [][] Date: Fri, 23 Mar 2001 15:31:27 +0100 Organization: Universitaet Kaiserslautern Lines: 32 Message-ID: References: <_msu6.644$I81 DOT 6431 AT nntp1 DOT chello DOT se> <99fckc$h04$1 AT node17 DOT cwnet DOT frontiernet DOT net> NNTP-Posting-Host: domino.informatik.uni-kl.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <99fckc$h04$1@node17.cwnet.frontiernet.net> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Hi, On Fri, 23 Mar 2001, Alexei A. Frounze wrote: > "Daniel Eliasson" wrote in message [...] > > 1. In a function, I declare the following variables: > > > > const int GRIDSIZE = 128; [...] > 1st of all, if you really want to have an array of adynamic size, use > malloc(),free(),realloc() and forget about the above stuff. If you don't > need arrays of variable size, define your GRIDSIZE as follows: > #define GRIDSIZE 128 [...] dont belive him. If you're a c++-programmer, try to avoid macros whereever possible. The gotw-pages contain some good reasons not to use them if you need some arguments (http://www.gotw.ca/gotw/index.htm, #32, #77). The compiler should accept const-dimensions for arrays, if not, post again and show us your problem, naming the compiler and error-messages and enough of the code. Stefan. -- Never dived for a disc? http://www.unix-ag.uni-kl.de/ultimate