c99 - bizarre C statement -
this question has answer here:
void test(int x[static 10]); int main() { int a[]={1,2,3,4,5,6,7,8,9,10,11}; test(a); return 0; } void test(int x[static 10]) { printf("%d",x[9]); }
i looking bizarre c statements. found one, not understand use of static 10
in statement. same int x[10]
?
another thing, can use volatile
also, in place of static
e.g int x[volatile 10]
knows use of kinda declaration?
ps: compiled using gcc 4.6.3,
it's hint compiler telling x
pointer parameter points first element of array of @ least 10
elements.
for example:
test(null); // undefined behavior
Comments
Post a Comment