fork download
  1. #include <iostream>
  2.  
  3. class X {
  4. public:
  5. X() : mX(0) {}
  6. X(int x) : mX(x) {}
  7.  
  8. int get() {
  9. return mX;
  10. }
  11.  
  12. private:
  13. int mX;
  14. };
  15.  
  16. int main() {
  17. X x;
  18.  
  19. x = 10;
  20.  
  21. std::cout << x.get();
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
10