[rescue] Cooling (Long Message, sorry)

Francisco Javier Mesa-Martinez lefa at cats.ucsc.edu
Thu Apr 18 13:22:52 CDT 2002


On Thu, 18 Apr 2002, Joshua D Boyd wrote:

> 
> How are you supposed to make variable sized float[][]s? 
> float f[][];
> causes a compile error saying:
> test.cc:7: declaration of `f' as multidimensional array
> test.cc:7: must have bounds for all dimensions except the first
> 
> Besides, how is new float[x][y] going to screw things up?  They had to have
> some reason for making it a legal operation.

Arrays should ALWAYS be static! I.e. their sizes should be known at
compile time. This makes more efficient stack allocation, if you need
dynamic storage use any of the data structures developed during 30+ yrs of
computer science for that effect. Even if you are using new.

The fact that it works in certain compiler *gnuc I guess, although I
haven't tried* doesn't mean that it is wise to employ such functionality.
It will certainly reduce the portability of the code. 



More information about the rescue mailing list