3 ms·
I've never seen this before: void bar(int myArray[static 10]) Is that standard, and if so, how long has it been? I also ran across this construct in a quic
by jmaygarden 14y ago
I've never seen this before:
void bar(int myArray[static 10])
Is that standard, and if so, how long has it been?
I also ran across this construct in a quick search [1]:
void bar(int myArray[const])
[1] http://stackoverflow.com/questions/3693429/c-parameter-array-declarators http://stackoverflow.com/questions/3693429/c-parameter-array...
- ehamberg 14y agoFrom http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf: 6.7.5.3 point 7: “If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression.”
- jmaygarden 14y agoSo, it was added in C11? UPDATE: Thanks. The 2005 date on the linked document threw me off.
- ehamberg 14y agoNo, C99 – this is the the C99 standard with corrigenda TC1, TC2, and TC3 included.