Josh Hurst wrote:

> On 11/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>>
>>
>> >Could you proove that?
>>
>>
>> Probably not, because C++ doesn't allow variable size arrays.
>>
>> Certainly, Sun's C++ compiler balks at:
>>
>> int
>> main(int argc, char ** argv)
>> {
>>         char *acp[argc];
>> }
>>
>>
>> with:
>>
>> "foo.C", line 4: Error: An integer constant expression is required
>> within the array subscript operator.
>> 1 Error(s) detected.
>>
>> gcc accepts this but then, it has seized to be a compiler of some
>> language.
>>
>> But it can be made to complain:
>>
>> gcc -ansi -pedantic foo.C
>> foo.C: In function `int main(int, char**)':
>> foo.C:4: error: ISO C++ forbids variable-size array `acp'
>
> If that's true then things have changed between The C++ Programming
> Language book by Bjarne Stroustrup, 2nd edition

Rather a lot has changed since the 2nd edition, the 1999 standard for
starters!

Ian.

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to