B
borophyll
I have two questions. The first: does the declaration of an array
parameter in a function prototype which uses the [*] notation mean
that the array must be a variable length array. That is, the
following code won't work:
int foo(int a[*]);
int foo(int a[])
{
return a[0];
}
and neither will the following:
int foo(int a[*]);
int foo(int a[6])
{
return a[0];
}
since neither are variable length arrays. Can someone confirm or deny
this? I can't test it myself as gcc doesn't implement this syntax
yet...
Second question: what effect does the static keyword have on array
declarators? For instance:
int foo(int a[static 6]) {...}
I have read and reread the spec on this matter, but do not understand
the semantics. Perhaps an example of its usage pls?
Regards,
B.
parameter in a function prototype which uses the [*] notation mean
that the array must be a variable length array. That is, the
following code won't work:
int foo(int a[*]);
int foo(int a[])
{
return a[0];
}
and neither will the following:
int foo(int a[*]);
int foo(int a[6])
{
return a[0];
}
since neither are variable length arrays. Can someone confirm or deny
this? I can't test it myself as gcc doesn't implement this syntax
yet...
Second question: what effect does the static keyword have on array
declarators? For instance:
int foo(int a[static 6]) {...}
I have read and reread the spec on this matter, but do not understand
the semantics. Perhaps an example of its usage pls?
Regards,
B.