fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i = 0;
  6. for(struct st{ int a{9}; }t;i<3;i++)
  7. printf("%d\n", t.a);
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:6:27: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘{’ token
       for(struct st{ int a{9}; }t;i<3;i++)
                           ^
prog.c:6:7: error: ‘struct st’ declared in ‘for’ loop initial declaration
       for(struct st{ int a{9}; }t;i<3;i++)
       ^~~
prog.c:7:29: error: ‘struct st’ has no member named ‘a’
             printf("%d\n", t.a);
                             ^
prog.c:6:33: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
       for(struct st{ int a{9}; }t;i<3;i++)
                                 ^
stdout
Standard output is empty