fork download
  1. #include <stdio.h>
  2.  
  3. void func() {
  4. static int x = 0;
  5. x++;
  6. printf("x = %d\n", x);
  7. }
  8.  
  9. int main() {
  10. func();
  11. func();
  12. func();
  13. return 0;
  14. }
  15.  
  16.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
x = 1
x = 2
x = 3