Hacker News new | comments | show | ask | jobs | submit login

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...

From http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf: 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.”

So, it was added in C11?

UPDATE: Thanks. The 2005 date on the linked document threw me off.

No, C99 – this is the the C99 standard with corrigenda TC1, TC2, and TC3 included.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact