how to declare dynamic 2-dimensional array in C++?

Alex Vinokur alexander.vinokur@telrad.co.il
Sun Jan 2 21:35:00 GMT 2000


In article <386fac89@eeyore.callnetuk.com>,
  "Chris Newton" <not@all.likely> wrote:
> Alex Vinokur <alexander.vinokur@telrad.co.il> 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.


More information about the Gcc-help mailing list