fork download
  1. #include <iostream>
  2.  
  3. void printIncrement(){
  4. static int x=0;
  5. std::cout << x << std::endl;
  6. x++;
  7. }
  8.  
  9. int main(){
  10. printIncrement();
  11. printIncrement();
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5392KB
stdin
Standard input is empty
stdout
0
1