Mail Archives: djgpp/2001/03/23/09:46:47
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 -