Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. class c1 {};
  4. class c2 : public c1 {};
  5. class c3 : public c1 {};
  6. class c4 : public c2, public c3 {};
  7.  
  8. int main () {
  9. c4 *x1 = new c4;
  10. c3 *x2 = x1;
  11. delete x2; // segmentation fault
  12. }
  13.  
  14. class c3 : public c1 {
  15. public:
  16. virtual ~c3() {}
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement