Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class C {
  2. public:
  3. C(int n=0) : number(n) { cout << "C(" << number << ") "; }
  4. ~C() { cout << " ~C "; }
  5. C(const C& c) : number(c.number) { cout << "Cc(" << number << ") "; }
  6. operator int() { cout << "int() "; return 3;}
  7. private:
  8. int number;
  9. };
  10. int F(C c) {return c;}
  11.  
  12. int main() {
  13. C *c=new C; cout << "UNO" << endl;
  14. C d; cout << "DUE" << endl;
  15. int x=F(d); cout << "TRE" << endl;
  16. C e=F(d); cout << "QUATTRO" << endl;
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement