What do I get if I declare an array without a size in global scope?
问题 In one of the answers in Tips for golfing in C, I saw this code (ungolfed version): s[],t; main(c){ for(scanf("%*d "); ~(c=getchar()); s[t++]=c) putchar(s[t]); } I think that the above program exhibits UB (but who cares in code golf?). But the thing that I don't understand is the s[] in global scope. I know that when the type of a global variable isn't specified, it defaults to int . I created a small program which surprisingly compiles: #include <stdio.h> int s[]; int main(void) { printf(