fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct node{
  5. int x, y;
  6. node(){x = 0, y = 0;}
  7. node(int x, int y):x(x), y(y){}
  8. node & operator = (const node & t){
  9. x = t.x;
  10. y = t.y;
  11. cout << "赋值" << endl;
  12. return *this;
  13. }
  14. };
  15. typedef enum{
  16. DIR_RIGHT = 6, DIR_DOWN, DIR_LEFT
  17. } DIR;
  18.  
  19. int main() {
  20. // your code goes here
  21. node *a = new node(1, 2);
  22. node *b = a;
  23. node c = node(1, 2);
  24. node d = c;
  25. cout << 123 << endl;
  26. return 0;
  27. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
123