fork download
  1. #include <stdio.h>
  2.  
  3. struct One{
  4. int a;
  5. int b;
  6. } s2,s1,*sp1;
  7.  
  8. int e;
  9. int ff;
  10.  
  11. struct Two{
  12. int c, d;
  13. } q,r,t, s4,s3;
  14.  
  15. struct Three
  16. {
  17. struct One one;
  18. struct Two two;
  19. };
  20.  
  21. void func1(struct One *arg1)
  22. {
  23. struct Three *lptr = (struct Three *)arg1;
  24. printf("%d\t", lptr->one.a);
  25. printf("%d\t", lptr->two.c);
  26. }
  27.  
  28. int main()
  29. {
  30. e=1;
  31. sp1=&s1;
  32. sp1->a=1;
  33. s4.c=22;
  34. s3.c=10;
  35. func1(sp1);
  36. struct Three * ll = (struct Three *) sp1;
  37. ll->two.c = 1000;
  38. printf("\n%d\t%d", s3.c, s4.c);
  39. return 0;
  40. }
Success #stdin #stdout 0.01s 5396KB
stdin
Standard input is empty
stdout
1	10	
10	22