B
BartC
James Kuyper said:On 04/24/2014 08:15 AM, BartC wrote:
...I can't get CDECL to accept 'const array'. That might be a bug in CDECL,
but
also in the C type syntax there doesn't seem anywhere to put a const for
an
array.
What does CDECL say about
const int array[5];
'const int ax[5]' results in ax (because 'array' is special) declared as:
'array 5 of const int'
So you can apply const to elements, but not to arrays (at least not without
the trick that Martin posted).
Although a const array, and an array of const elements, achieve the same
thing, it still appears the case that an array itself can't be const. (Even
when using a typedef to apparently apply const to an array, I think it is
applied instead to the elements.)