fork download
  1. #include <iostream>
  2.  
  3. int bar;
  4. class Foo
  5. {
  6. public:
  7. Foo() : bar(10) {
  8. std::cout << this->bar << std::endl;
  9. std::cout << Foo::bar << std::endl;
  10.  
  11. std::cout << this->foobar << std::endl;
  12. std::cout << Foo::foobar << std::endl;
  13. }
  14.  
  15. static int foobar;
  16. private:
  17. int bar;
  18. };
  19.  
  20. int Foo::foobar = 20;
  21.  
  22. int main() {
  23. Foo f;
  24. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
10
10
20
20