Florian Weimer <f...@deneb.enyo.de> writes: > G++ currently accepts the following code: > > char * > alloc(unsigned a, unsigned b) > { > typedef char array[a]; > return &**(new array[b]); > } > > Is this intentional? The equivalent "new char[a][b]" is rejected (as > required by the C++ standard).
Is there any reason that g++ should reject your sample program? Because of the existence of operator new[], "new char[a][b]" quite a bit harder to understand than your code is. Ian