fork(3) download
  1. #include <stdio.h>
  2.  
  3. struct A
  4. {
  5. struct B{};
  6. };
  7.  
  8. struct B
  9. {};
  10.  
  11. int main() {
  12. printf("%d | %d", sizeof(struct A), sizeof(struct B), sizeof(struct A::struct B));
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 9424KB
stdin
Standard input is empty
compilation info
prog.c:5:12: warning: declaration does not declare anything
  struct B{};
            ^
prog.c:8:8: error: redefinition of ‘struct B’
 struct B
        ^
prog.c:5:9: note: originally defined here
  struct B{};
         ^
prog.c: In function ‘main’:
prog.c:12:71: error: expected ‘)’ before ‘:’ token
  printf("%d | %d", sizeof(struct A), sizeof(struct B), sizeof(struct A::struct B));
                                                                       ^
prog.c:12:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
  printf("%d | %d", sizeof(struct A), sizeof(struct B), sizeof(struct A::struct B));
           ^
prog.c:12:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
  printf("%d | %d", sizeof(struct A), sizeof(struct B), sizeof(struct A::struct B));
                ^
prog.c:12:9: warning: too many arguments for format [-Wformat-extra-args]
  printf("%d | %d", sizeof(struct A), sizeof(struct B), sizeof(struct A::struct B));
         ^~~~~~~~~
stdout
Standard output is empty