C++ multi-inheritance

Discussion in 'C++' started by vql, Sep 27, 2007.

  1. vql

    vql New Member

    Joined:
    Sep 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    It said that C++ have disadvantages like as multi-inheritance. Because modern languages (C#, Java) don't use multi-inheritance, and they replace with the keyword interface. Anyone tell me why C++ have disadvantage about multi-inheritance, and try give me an example. Thanks.

    Final, please tell me other disadvantages of C++. Thanks a lot.
     
  2. vql

    vql New Member

    Joined:
    Sep 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Anyone can help me? I am learning C++. Thanks.
     
  3. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    The advantage of multiple inheritance is that you can inherit functionality from more than one object. Obviously, it would be bad if both objects had a member with the same name. It can also lead to unwarranted complexity. An interface is not multiple inheritance. C# and Java use virtual machines. Thus, their efficiency is reduced.

    For questions like this, you should either study the materials that have been provided to you, or resort to Google. The answers are not simple or cast in concrete. You might have a look here.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice