fork(3) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* Declaring a typedef struct */
  5. typedef struct{
  6. int a;
  7. char b[10];
  8. }struct_one;
  9.  
  10. /* Declaring another structure, with an intentional wrong calling of the first structure */
  11. struct struct_two{
  12. int p;
  13. char q[10];
  14.  
  15. /* This doesn't work as expected... should be: struct_one var; */
  16. // struct struct_one var;
  17.  
  18. /* THIS ONE DOES WORK!!, and i'm not sure why */
  19. struct struct_one *ptr;
  20. };
  21.  
  22. int main(void) {
  23. /* code */
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 2108KB
stdin
Standard input is empty
stdout
Standard output is empty