SHARE
TWEET

Untitled

a guest Jun 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class B1 {
  2. public:
  3.     int b1;
  4. };
  5.  
  6. class B2 {
  7. public:
  8.     int b2;
  9. };
  10.  
  11. class C:
  12.     virtual public B1,
  13.     public B2 {
  14. public:
  15.     int c;
  16. };
  17.  
  18. C obj;
  19.  
  20. MAIN
  21. {
  22.     int (B1::*pb1) = &B1::b1;
  23.     int (B2::*pb2) = &B2::b2;
  24.  
  25.     obj.b1 = 17;
  26.     obj.b2 = 18;
  27.  
  28.     int (C::*ip) = pb1;     // implicit conversion
  29. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top