Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct V {
- int x = 9;
- };
- struct W{
- int y = 8;
- };
- struct A : virtual V{
- int x = 10;
- int y = 7;
- };
- struct B : virtual V, virtual W{
- };
- struct D : A, B {
- };
- int main() {
- D d;
- std::cout << d.x << d.y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement