fork(4) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Simple
  5. {
  6. public:
  7. static int f()
  8. {
  9. X = X + 10;
  10. return 1;
  11. }
  12.  
  13. static int X;
  14. };
  15. int Simple::X = 0;
  16.  
  17. int main() {
  18. Simple::X += Simple::f();
  19. printf("X = %d", Simple::X);
  20. return 0;
  21. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
X = 11