Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. struct V {
  4.   int x = 9;
  5. };
  6.  
  7. struct W{
  8.   int y = 8;
  9. };
  10.  
  11. struct A : virtual V{
  12.   int x = 10;
  13.   int y = 7;
  14. };
  15.  
  16. struct B : virtual V, virtual W{
  17.  
  18. };
  19.  
  20. struct D : A, B {
  21.  
  22. };
  23.  
  24. int main() {
  25.   D d;
  26.   std::cout << d.x << d.y;
  27.  
  28.   return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement