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.
Because argc is not an "integer constant expression". :-)
#include <iostream>
using namespace std;
static const int len = 8;
int
main(int argc, char* argv[])
{
char *acp[len];
return 0;
}
This compiles with Studio 11 and -xlang=c99.
--Stefan
--
Stefan Teleman
[EMAIL PROTECTED]
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code