Given,
<code>int last(int arr[3][6]) {
return arr[2][5];
}
</code>
<code>int last(int arr[3][6]) {
return arr[2][5];
}
</code>
int last(int arr[3][6]) {
return arr[2][5];
}
I want to make it clear that arr
can’t be null with the static
keyword.
The problem is that the following code won’t work.
<code>int last(int arr[static 3][static 6]) {
return arr[2][5];
}
</code>
<code>int last(int arr[static 3][static 6]) {
return arr[2][5];
}
</code>
int last(int arr[static 3][static 6]) {
return arr[2][5];
}
Using gcc13 -std=c2x
I get:
<code>error: static or type qualifiers in non-parameter array declarator
</code>
<code>error: static or type qualifiers in non-parameter array declarator
</code>
error: static or type qualifiers in non-parameter array declarator
Why can I do arr[static 3][6]
and not arr[static 3][static 6]
?