mihaild

Untitled

May 22nd, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. class A {
  2.   int x;
  3. public:
  4.   operator int() { return x; };
  5. };
  6.  
  7. class B {
  8.   A y;
  9. public:
  10.   operator A() { return y; };
  11. };
  12.  
  13. int main () {
  14.   B b_obj;
  15. //  int i = b_obj;
  16.   int j = A(b_obj);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment