fork download
  1. class A
  2. {
  3. public:
  4. A(float x=0.0f, float y=0.0f): x(x), y(y) { ; }
  5. A(const A& a): x(a.x), y(a.y) { ; }
  6.  
  7. A& operator=(const A& a) { x=a.x; y=a.y; return *this; }
  8. A& operator=(const float z) {x=z; y=0.0f; return *this; }
  9.  
  10. private:
  11. float x;
  12. float y;
  13. };
  14.  
  15. int main()
  16. {
  17. A a;
  18. A b = 0.0f;
  19. A c;
  20. c = b;
  21. a = 15.0f;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
Standard output is empty