比如这个程序:
#include <stdio.h>
struct sdshdr {
long len;
long free;
char buf[];
};
int main(void) {
char buf[];
printf("%d %d %d\n", sizeof(buf), sizeof(long), sizeof(struct sdshdr));
return 0;
}
sdshdr中的buf是合法的,但main中的buf却不是合法的。请问怎么理解呢?有哪里可以看到相关的语法说明呢?
谢谢!