Hybrid Inheritance in C++ with Diamond Problem and its Resolution | Virtual Inheritance in C++

Поделиться
HTML-код
  • Опубликовано: 1 янв 2025
  • Support Simple Snippets by Donations -
    Google Pay UPI ID - tanmaysakpal11@okicici
    PayPal - paypal.me/tanmaysakpal11
    --------------------------------------------------------------------------------------------- In this video tutorial we will study and understand the concept of Hybrid Inheritance and see the theory as well as a practical program example code. We will also see the diamond problem that arises in this hybrid inheritance and also learn how to resolve it.
    Hybrid Inheritance is implemented by combining more than one type of inheritance. For example: Combining Hierarchical inheritance and Multiple Inheritance.
    Hybrid Inheritance in C++ Theory Article - simplesnippets...
    Download Dev C++ IDE : sourceforge.ne....
    Download C++ Android App : play.google.co...
    Simple Snippets Official Website -
    simplesnippets...
    Simple Snippets on Facebook-
    / simplesnippets
    Simple Snippets on Instagram-
    / simplesnipp. .
    Simple Snippets Google Plus Page-
    plus.google.co...
    Simple Snippets email ID-
    simplesnippetsinfo@gmail.com
    For Classroom Coaching in Mumbai for Programming & other IT/CS Subjects Checkout UpSkill Infotech - upskill.tech/
    UpSkill is an Ed-Tech Company / Coaching Centre for Information Technology / Computer Science oriented courses and offer coacing for various Degree courses like BSc.IT, BSc.CS, BCA, MSc.IT, MSc.CS, MCA etc.
    Contact via email /call / FB /Whatsapp for more info
    email - upskillinfotech@gmail.com
    We also Provide Certification courses like -
    Android Development
    Web Development
    Java Developer Course
    .NET Developer Course
    Check us out on Social media platforms like Facebook, Instagram, Google etc
    Facebook page - / upskillinfotech
    Insta page - / upskill_infotech
    Google Maps - goo.gl/maps/vj...

Комментарии • 47

  • @SimpleSnippets
    @SimpleSnippets  5 лет назад +8

    Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

  • @thereisnoname0859
    @thereisnoname0859 3 года назад +15

    underrated channel.I always tell my friends how perfect tutorial u are

  • @amutha6579
    @amutha6579 5 лет назад +7

    you are making effort to educate others.thank you.

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад +1

      Trying my best to share my knowledge with everyone 😊
      You can assist me in this vision by sharing my videos & channel with your friends and asking them to subscribe too. That's the biggest help & support you can provide Amutha 😊✌️

  • @adarshkrchaudhary2269
    @adarshkrchaudhary2269 4 года назад +3

    Hi just commenting on channels which helped me in one way or the other, land a great job offer from a huge firm! Thanks! I shared the channel with other people too!

    • @SimpleSnippets
      @SimpleSnippets  4 года назад +1

      Glad to help Adarsh and congrats on your Job. This makes the really Happy 🙂

  • @sgowda6117
    @sgowda6117 3 года назад

    you are one of the best guy to explains things in very simple ways. awesome

  • @tanyachhetri9406
    @tanyachhetri9406 3 года назад +1

    Great explanation. Even answers all queries which may arise.

  • @dynamic-babu-ez8zx
    @dynamic-babu-ez8zx 3 года назад +2

    Thank you so much you made it too easy .. bless you..

  • @snehastudy4107
    @snehastudy4107 5 лет назад +3

    Sir, you are absolutely amazing. You make the concepts very clear. Thanks a lot.

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад

      That's great to know Sneha! I'm glad you liked the videos 😁 please do share them with your friends too ✌️

    • @snehastudy4107
      @snehastudy4107 5 лет назад +2

      @@SimpleSnippets Sure !

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад

      @@snehastudy4107 thank you 😁

  • @UmairKhan-ye1wr
    @UmairKhan-ye1wr 3 года назад +1

    GREAT EXPLANATION, JUST AAZING.
    THANKS A LOT...

  • @graspitfast3369
    @graspitfast3369 6 лет назад +1

    love your videos. it helps me a lot. the way uv not dragged the videos ...its really easy to understand. thanks a lot

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад +1

      Thank you so much for such a wonderful response and review. This really makes me happy to hear that these videos are helpful to you. 😇✌️
      Please do share the videos with your friends and keep sharing the knowledge 😇

  • @jyotimehrotrajyoti5139
    @jyotimehrotrajyoti5139 4 года назад +2

    Good job 👍👍
    Nice representation of work as well as explained well.

    • @SimpleSnippets
      @SimpleSnippets  4 года назад

      Thanks Jyoti, means a lot. Please do share the channel with your friends & ask them to join our Subscriber family too😊 that will be the biggest help & support 🤟

  • @deshabhaktgavali1846
    @deshabhaktgavali1846 4 года назад

    Thank you so much brother for making such beautiful videos. Please keep making these type of videos. Lots of love!!!

  • @jamesnash9675
    @jamesnash9675 2 года назад

    you are the best.............masum

  • @anubhav_gupta_ji
    @anubhav_gupta_ji 6 лет назад +3

    Bhai tumhara to sikka chalna chahiye tha youtube pe itna ghazab phadaate ho🙌🏻

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад +2

      Thank you anubhav. Very happy to hear your feedback and positive review. Bas share kardo videos apne dosto main. Bohot help and support hojayega channel ko 😊✌️

  • @graspitfast3369
    @graspitfast3369 6 лет назад +5

    u need to be recognised more. ur amazing

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад +3

      Thank you so much ya. Well you can really help by sharing my videos with your friend. That'll be helpful in sharing the knowledge as well 😇✌️

    • @graspitfast3369
      @graspitfast3369 6 лет назад +2

      yes sure

  • @naeroforceofficial
    @naeroforceofficial 5 лет назад +5

    I have a big question that I find ambiguous about this video, hope you will see this :) I have more questions but maybe they will all get answered if I simply ask this: Why should I use the virtual inheritance?
    It seems like it's very similar to create a static member except it's less clear where it comes from and what its value is. What are the circumstances that puts me in the condition of using virtual inheritance?
    Thanks for the videos! :D

  • @rajneeshkumararya3643
    @rajneeshkumararya3643 Год назад

    Your uploading a good content for programmers another channel secured syntax is also good but for hackers and cybersecurity

  • @جيمرمصري-ق5ق
    @جيمرمصري-ق5ق 5 лет назад

    3:58 does the derived class take copy of the variable val alll do all of them share the same variable?

  • @rishabh7011
    @rishabh7011 4 года назад +1

    Sir why can't we change the base class public data members inside our derived class (not inside constructor) ??

  • @yashtiwari7509
    @yashtiwari7509 4 года назад +1

    You are much better than vikash pandey

  • @DanielStJohn-hc7mh
    @DanielStJohn-hc7mh 2 года назад

    nice job

  • @mohithvarigonda9516
    @mohithvarigonda9516 4 года назад +1

    bro can you explain me why can't we use the same concept in java for multiple and hybrid inheritance?

    • @antonychristos
      @antonychristos 4 года назад

      Java doesn't support multiple inheritance. To implement multiple inheritance in java we use the concept of interface

  • @pranavgarg1990
    @pranavgarg1990 3 года назад

    sir here both base class1 and base class 2 have the function of base class 0 so in child class when multiple inheritance takes place does the funtion of base class gets copied twice??

  • @himanigulati6922
    @himanigulati6922 4 года назад

    the code should work if i take member methods instead of constructors
    but it gives an error.

  • @yashtiwari7509
    @yashtiwari7509 4 года назад +1

    You are much better than Vikash Pandey.

  • @TheAdityaVerma
    @TheAdityaVerma 5 лет назад

    wat if we directly try to print val in get value function of drieved class 3?

    • @TheAdityaVerma
      @TheAdityaVerma 5 лет назад

      will there be any error?

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад

      How about you try it and let me know 🤟

    • @Danny-007
      @Danny-007 4 года назад

      @@TheAdityaVerma arey dynamic programming wale bhaiyya

    • @gokulnaathb2627
      @gokulnaathb2627 3 года назад

      @@TheAdityaVerma It'll be ambiguous as we're inheriting 2 copies of val, one from base class 1 and one from base class 2. The compiler will not know which value to print.

  • @rezwanmuid7649
    @rezwanmuid7649 6 лет назад

    can you please upload regarding even driven programming???

  • @GowthamVarmaSrinivasan
    @GowthamVarmaSrinivasan 2 года назад

    Honestly, this video was quite confusing because you are using derived1::getValue() function to set the tone to the problem, but when we do virtual inheritance this call within the getValue() has no relevance. Would have been better if you cut to the chase right from the beginning : "For hybrid inheritance, the last class in the inherited virtual class list is considered in case of ambuity."

  • @rohitnangare1296
    @rohitnangare1296 5 лет назад

    Bro you are teaching wrong thing.
    When the derived3 object is getting created the compiler goes through both derived1 and derived2 constructor that is why the value changes for val . To prove this place brake points in both constructors.

  • @Ayush-1911
    @Ayush-1911 11 месяцев назад

  • @nitishk6471
    @nitishk6471 6 лет назад

    10: 00