Advertisement
elvman

Untitled

Oct 15th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. class Foo
  2. {
  3. public:
  4.     void update()
  5.     {
  6.         ((Bar*)this)->baz = 10;
  7.     }
  8. };
  9.  
  10. class Bar: public Foo
  11. {
  12. public:
  13.     void update()
  14.     {
  15.         Foo::update();
  16.     }
  17. protected:
  18.     int baz;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement