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!
Really hard to find good ressources on diamond inheritance, this is pure gold ! Thanks a lot !
You're welcome Romain, I'm glad you found the video helpful! :-)
Glad I found this video, it answered literally every single question I had regarding multiple inheritance. Thanks for the video.
I’m glad the video answered your questions, and you’re welcome! :-)
Reviewing for an interview because I’m a Java coder. And ran into this video. Love it. Straight to the point. Clear and understandable
Thank you very much for the kind and positive feedback. :-) And good luck on your job interview!!!
Simple, and to the point, hard to find these kind of resources on yt
Thanks man for this video! Very clear and easy to understand, keep doing!
You're welcome, I'm glad to hear you enjoyed it, and I'll definitely keep making videos. 🙂
Wow, Great job. Thanks for this quality learning material.
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).
I had not heard of NURBS until you left this comment, I'm researching it now. :-)
@@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!
Cool! :-)
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?
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
That was what I was exactly searching for thanks
You’re welcome! :-)
could you do c++ exceptions tutorial
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". :-)
Amazing
I’m glad you like it! :-)
@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".
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.