Advertisement
orgads

Untitled

Dec 12th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. struct Base
  2. {
  3.     virtual ~Base() {}
  4.     int id;
  5. };
  6.  
  7. struct Derived : Base
  8. {
  9.     int d;
  10. };
  11.  
  12. int foo(Base *b)
  13. {
  14.     return 0;
  15. }
  16.  
  17. int main()
  18. {
  19.     Derived d;
  20.     foo(&d);
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement