Multiple Inheritance Deep Dive | C++ Tutorial

Sdílet
Vložit
  • čas přidán 18. 03. 2022
  • 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/portfoliocourses/c.... Check out www.portfoliocourses.com to build a portfolio that will impress employers!
  • Jak na to + styl

Komentáře • 24

  • @romainmorel3343
    @romainmorel3343 Před rokem +9

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

    • @PortfolioCourses
      @PortfolioCourses  Před rokem

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

  • @dominiorrr6510
    @dominiorrr6510 Před rokem +3

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

    • @PortfolioCourses
      @PortfolioCourses  Před rokem +1

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

  • @dannggg
    @dannggg Před rokem +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  Před rokem

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

  • @MrIgorek123
    @MrIgorek123 Před 2 lety +1

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

    • @PortfolioCourses
      @PortfolioCourses  Před 2 lety

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

  • @amaama4140
    @amaama4140 Před 6 měsíci

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

  • @hamdansiddiqui3294
    @hamdansiddiqui3294 Před 7 měsíci

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

  • @eh4756
    @eh4756 Před 2 lety

    That was what I was exactly searching for thanks

  • @harishkuppam5756
    @harishkuppam5756 Před rokem

    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 Před 7 měsíci

    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

  • @TheRojo387
    @TheRojo387 Před rokem

    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  Před rokem

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

    • @TheRojo387
      @TheRojo387 Před rokem

      @@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  Před rokem

      Cool! :-)

  • @didiTchu
    @didiTchu Před rokem

    could you do c++ exceptions tutorial

    • @PortfolioCourses
      @PortfolioCourses  Před rokem +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 Před 2 lety

    Amazing

  • @IsaacC20
    @IsaacC20 Před rokem

    @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  Před rokem

      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.