fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Foo
  5. {
  6.  
  7. private:
  8.  
  9. int x;
  10.  
  11. public:
  12.  
  13. int get()
  14. {
  15. return x;
  16. }
  17.  
  18. void set(int input)
  19. {
  20. x = input;
  21. }
  22.  
  23. };
  24.  
  25. int main()
  26. {
  27.  
  28. Foo bar;
  29. bar.set(1337);
  30.  
  31. std::cout << bar.get() << std::endl;
  32.  
  33. return 0;
  34. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1337