fork download
  1. #include <stdio.h>
  2.  
  3. struct S {
  4. int x,y;
  5. int *p;
  6. };
  7.  
  8. void f(struct S s) {
  9. s.p = &(s.y);
  10. }
  11.  
  12. int main(void) {
  13. // your code goes here
  14. struct S s;
  15. s.x = 1;
  16. s.y = 2;
  17. s.p = &(s.x);
  18.  
  19. f (s);
  20. printf("%x\n", *(s.p));
  21. }
  22.  
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout
1