fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Test{
  5. private:
  6. int y;
  7. int x;
  8.  
  9. public:
  10. Test():x(10),y(x+10){
  11. //x=10;
  12. //y=x+10;
  13. }
  14. void print();
  15. };
  16.  
  17. void Test::print(){
  18. cout<<"X="<<x<<"Y="<<y<<endl;
  19. }
  20.  
  21. int main(){
  22. Test t;
  23. t.print();
  24. return 0;
  25. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
X=10Y=-1220190633