Eric wrote:

> I get the error "an array reference cannot appear in a
> constant-expression" when compiling the following line of code: 
> int (*debug)[dims[2]][dims[3]] = new int[dims[1]][dims[2]][dims[3]];

I'm not sure what it is you are doing there, but most probably the problem
can be reduced to this:

int size = ...;
float array[size];

which is not valid C++ (and has never been). Yes, there is a GCC extension
that makes this work, but it's not C++.

> This code compiled and worked fine previous to GCC 3.4.2.  Am I
> approaching this the wrong way?  

If I were you, I'd consider using typedefs. As soon as you have a variable
in one of the typedefs, you also know that you did something outside of
C++.

In case you're not doing this for fun or education, take a look at boost or
blitz, I think both have n-dimensional array types.

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/

_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to