G
Gopi Sundaram
I have the following code:
const int num_segments = 16;
int some_function(void)
{
int key[num_segments + 2];
...
}
My compiler barfs out the warning "ANSI C forbids variable-size array",
but lets it pass.
Does an expression using a const-variable count for the purposes of
"variable-size array"? I was under the impression that declaration is
legal ANSI C.
const int num_segments = 16;
int some_function(void)
{
int key[num_segments + 2];
...
}
My compiler barfs out the warning "ANSI C forbids variable-size array",
but lets it pass.
Does an expression using a const-variable count for the purposes of
"variable-size array"? I was under the impression that declaration is
legal ANSI C.