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