0

I found a function definition on a Wikipedia page shaped like this:

int foo(int array[static 4])
{
    //irrelevant...
}

While I am familiar with the use of static in affecting external linking (outside of a function; seems unrelated) and providing persistant state for function variables (array is an input here, and static would be before int), making a constant static on an array input looks... weird. It can't force input arrays to be a constant size, since arrays are treated as pointers internally by C. So, what does this DO? And when is a good time to use it?

Orion
  • 1,112
  • 9
  • 18

0 Answers0