fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int *ptr1, *ptr2;
  5. {
  6. int x[8];
  7. scanf("%d", x);
  8. printf("You entered x=%d\n", x[0]);
  9. ptr1 = x;
  10. }
  11. {
  12. int y[8];
  13. scanf("%d", y);
  14. printf("You entered y=%d\n", y[0]);
  15. ptr2 = y;
  16. }
  17. printf("Now x=%d\n", *ptr1);
  18. printf("Now y=%d\n", *ptr2);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 2172KB
stdin
5
123
stdout
You entered x=5
You entered y=123
Now x=123
Now y=123