fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. struct Foo
  4. {
  5. static int x;
  6. public:
  7. static void SetValue();
  8. static void ShowValue();
  9.  
  10. };
  11.  
  12. int Foo::x=0;
  13. void Foo::SetValue(){
  14. x=10;
  15. }
  16. void Foo::ShowValue(){
  17. cout<<x<<endl;
  18. }
  19. int main()
  20. {
  21.  
  22. Foo::SetValue();
  23. Foo::ShowValue();
  24. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
10