Multiple Inheritance Deep Dive | C++ Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024
  • A deep dive into multiple inheritance in C++, covering how it works, and resolving the ambiguities that can result from multiple inheritance, as well as handling the diamond problem (including how constructors work in this situation) . Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!

ความคิดเห็น • 24

  • @romainmorel3343
    @romainmorel3343 2 ปีที่แล้ว +9

    Really hard to find good ressources on diamond inheritance, this is pure gold ! Thanks a lot !

    • @PortfolioCourses
      @PortfolioCourses  2 ปีที่แล้ว

      You're welcome Romain, I'm glad you found the video helpful! :-)

  • @dominiorrr6510
    @dominiorrr6510 ปีที่แล้ว +3

    Glad I found this video, it answered literally every single question I had regarding multiple inheritance. Thanks for the video.

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว +1

      I’m glad the video answered your questions, and you’re welcome! :-)

  • @dannggg
    @dannggg 2 ปีที่แล้ว +2

    Reviewing for an interview because I’m a Java coder. And ran into this video. Love it. Straight to the point. Clear and understandable

    • @PortfolioCourses
      @PortfolioCourses  2 ปีที่แล้ว

      Thank you very much for the kind and positive feedback. :-) And good luck on your job interview!!!

  • @hamdansiddiqui3294
    @hamdansiddiqui3294 11 หลายเดือนก่อน

    Simple, and to the point, hard to find these kind of resources on yt

  • @MrIgorek123
    @MrIgorek123 2 ปีที่แล้ว +1

    Thanks man for this video! Very clear and easy to understand, keep doing!

    • @PortfolioCourses
      @PortfolioCourses  2 ปีที่แล้ว

      You're welcome, I'm glad to hear you enjoyed it, and I'll definitely keep making videos. 🙂

  • @amaama4140
    @amaama4140 11 หลายเดือนก่อน

    Wow, Great job. Thanks for this quality learning material.

  • @TheRojo387
    @TheRojo387 ปีที่แล้ว

    So for the case of NURBS, the inheritance ladder goes Bézier (the root)-B-Spline-Non-uniform/Rational (two peer classes)/NURBS (inheriting from both Non-uniform and Rational).

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      I had not heard of NURBS until you left this comment, I'm researching it now. :-)

    • @TheRojo387
      @TheRojo387 ปีที่แล้ว

      @@PortfolioCourses I took quite the interest in spline curves since I have worked with them via Realsoft and Blender (though Realsoft only uses NURBS as it's an industry standard), and am even incorporating them into some software of my own creation. The name NURBS is an acronym for Non-Uniform Rational Basis Spline.
      Be warned; I'm writing software designed to make you THINK!

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      Cool! :-)

  • @harishkuppam5756
    @harishkuppam5756 ปีที่แล้ว

    So in default constructor of BaseClass1, if we inialize a value member of BaseClass1, it will not be initialized when derived class object is made? Because Common base class constructor is called?

  • @ertemeren
    @ertemeren ปีที่แล้ว

    I think that having a full-screen view, which would allow us to see all the code at once, might be better. Scrolling make it not easy to follow

  • @eh4756
    @eh4756 2 ปีที่แล้ว

    That was what I was exactly searching for thanks

  • @didiTchu
    @didiTchu 2 ปีที่แล้ว

    could you do c++ exceptions tutorial

    • @PortfolioCourses
      @PortfolioCourses  2 ปีที่แล้ว +3

      Yes, that is a topic I've wanted to do for a long time now. The only problem I'm having is that it's difficult to know what topics to include in what videos. Exceptions get pretty complicated. I've thought about doing a short introduction video followed by an in-depth video, but with exceptions it's tricky to know when to "cut things off". :-)

  • @ekaeo
    @ekaeo 2 ปีที่แล้ว

    Amazing

  • @IsaacC20
    @IsaacC20 ปีที่แล้ว

    @3:14 Incorrect. function1() isn't overridden *at all* because neither base classes declare function1() as virtual. The static type of "derived'" is DerivedClass so at runtime DerivedClass::function1() is called. If it *was* overridden (which it is not) then, given this code:
    DerivedClass dc1;
    BaseClass2 *bc2ptr = &dc1;
    bc2ptr ->function1(); // This line would print "Function1 DerivedClass"
    But instead it prints out "Function1 BaseClass2".

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      No that is incorrect, the video correctly identifies the function1() as being overridden. The keyword virtual is not required for a function to be overridden: www.geeksforgeeks.org/function-overriding-in-cpp/. The virtual keyword is used for dynamic binding / polymorphism which is a related concept: www.geeksforgeeks.org/dynamic-binding-in-cpp/. Because the comment is incorrect I'll be deleting it shortly, I don't want viewers trying to learn to be confused, but I'll try to leave this up for a bit for you to see it.