fork download
  1. #include<stdio.h>
  2. int *func()
  3. {
  4. static int d;
  5. return &d;
  6. }
  7.  
  8. int main()
  9. {
  10. int i;
  11.  
  12. *(func()) = 123;
  13. i = *(func());
  14. printf("%d\n", i);
  15.  
  16. *(func()) = 321;
  17. i = *(func());
  18. printf("%d\n", i);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
123
321