51_static.c 399 B

12345678910111213141516171819202122232425262728293031
  1. #include <stdio.h>
  2. static int fred = 1234;
  3. static int joe;
  4. void henry()
  5. {
  6. static int fred = 4567;
  7. printf("%d\n", fred);
  8. fred++;
  9. }
  10. int main()
  11. {
  12. printf("%d\n", fred);
  13. henry();
  14. henry();
  15. henry();
  16. henry();
  17. printf("%d\n", fred);
  18. fred = 8901;
  19. joe = 2345;
  20. printf("%d\n", fred);
  21. printf("%d\n", joe);
  22. return 0;
  23. }
  24. /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/