need help guys

Discussion in 'Software' started by skyler43@123, May 13, 2012.

  1. skyler43@123

    skyler43@123 Private E-2

    class B { /* */ };
    class D1: virtual B { /* */ };
    class D2: virtual B { /* */ };
    class D3: B { /* */ };
    class D4: private B { /* */ };
    class D5: virtual public B { /* */ };
    class M1: D1, public D2, D3, private D4, virtual D5
    { /* i */ };
    class M2: D1, D2, virtual D3, virtual D4, virtual D5
    { /* */ };
    how many times is class B inherited in class M1 and M2\?
    i understood that virtual public inheritance has priority from virtual private, and that i have:
    a base class(B), two inherited virtual public(D1, D2), one let's say just public(D3), if i have a 4-th(M) class which inherited public form all of them(D1, D2, D3), this has two subobjects of class B(from D1 and D2) and one from D3,
    but i don't understand this example which i posted here...please help:D
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds