fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Demo_StaticVar
  5. {
  6. public :
  7. static int a;
  8.  
  9. Demo_StaticVar()
  10. {
  11. cout<<a<<endl;
  12. }
  13.  
  14. };
  15.  
  16. int Demo_StaticVar::a;
  17.  
  18. int main()
  19. {
  20. Demo_StaticVar obj1;
  21.  
  22.  
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 4260KB
stdin
Standard input is empty
stdout
0