delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/23/09:46:47

From: Stefan Hoehne <s_hoehne AT informatik DOT uni-kl DOT de>
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: <Pine.GSO.4.31.0103231512290.22997-100000@domino.informatik.uni-kl.de>
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
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

Hi,

On Fri, 23 Mar 2001, Alexei A. Frounze wrote:
> "Daniel Eliasson" <danieleliasson AT chello DOT se> 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


- Raw text -


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