When using variable-Length Array as parameter in function
int sum(int n, int a[n]);
it is easy to understand first para
When you put the star in an actual function it gives this error test.c:3: error: ‘[*]’ not allowed in other than function prototype scope
. After some research this is actually a way to declare a VLA in a function prototype, with the *
in place of the variable name. VLA.
The issue at hand here is that if you put a variable instead of the star for a VLA, it will tell you that it is undeclared, so the star is a way that c99 built in to get around that.