fork download
  1. #include <stdio.h>
  2. struct A {
  3. int bar;
  4. struct B { int foo; } b;
  5. };
  6.  
  7. int main(void) {
  8. struct A a;
  9. a.bar = 42;
  10. a.b.foo = -1;
  11. printf("a.bar is %d; a.b.foo is %d\n", a.bar, a.b.foo);
  12. struct B b; /* struct B is visible outside struct A */
  13. b.foo = 666;
  14. printf("b.foo - a.bar is %d\n", b.foo - a.bar);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
a.bar is 42; a.b.foo is -1
b.foo - a.bar is 624