From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vinokur To: help-gcc@gnu.org Subject: Re: how to declare dynamic 2-dimensional array in C++? Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <84pbp4$j4t$1@nnrp1.deja.com> References: <386da233.0@news.tm.net.my> <84n59m$daj$1@nnrp1.deja.com> <386fac89@eeyore.callnetuk.com> X-SW-Source: 2000-q1/msg00017.html Message-ID: <20000401000000.9UjZ4ba4NzbRDLoR0tmhklLnHfXcGV1Ae5XNsjBVEZ0@z> In article <386fac89@eeyore.callnetuk.com>, "Chris Newton" wrote: > Alex Vinokur wrote... > > The following construction is valid in gcc/g++ compiler (See my original message). > > [snip] > > > > > > > int main () > > { > > foo (10, 200, 3000); > > return 0; > > } > > Sorry, but no, that's not valid. Please see the C++ Standard, sections > 8.3.4 (on arrays) and 5.19 (on the definition of an integral constant > expression). > > Cheers, > Chris > > GNU compiler (gcc/g++/egcs) contains several advanced non-standard features. For instance, 1. void foo (int s1, int s2, int s3) { char aaa [s1] [s2] [s3]; } That code is legal in g++. 2. switch (value) { case 1 : break; case 100 ... 200 : // Legal in g++ break; } 3. __PRETTY_FUNCTION__ --FUNCTION__ (Does anybody know something else?) (I think) All these feature are very useful. Of course we have to realize that they are non-standard. By the way, is it worth standardizing them? Alex Sent via Deja.com http://www.deja.com/ Before you buy.