Single Inheritance Deep Dive: Examples + Code | C++ Tutorials for Beginners #38

preview_player
Показать описание

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

One of the best coding tultor in the world ❤️

prashantpanchal
Автор

16:26 No, as its an private member of base class so we can't change its value directly,
but we can make a public member in base class which changes it's value and can use this member by inheritance in another class

goodcake
Автор

It is my first time studying OOP and I find inheritance easy! Came here after C. Thank you Harry bhai.

ronnie_
Автор

In 2020, there are 303k subscribers now its 5.25 million this is our love to you Harry bhai, Thank you for such a valuable content.

TON-
Автор

Harry bhaiyya ne kaha tha k ye topic bhot difficult lagta hai logo ko but unhone jitni acche se samjhaya hai laga hi nhi kahi se bhi difficult 😇

shubhamhire
Автор

16:25 yeah!!! by simply creating a base member function which takes an integer argument.

thatowlfromhogwarts
Автор

16:26 yes we can set data1 in display as well as process function in place of getdata1(), just we need to make friend class drived in base class and thats all we need to do .

godlovegaming
Автор

HARRY BHAI AAP CODING BAHUT EASY & SAMAJH ME AYE AISA SIKHATE HO 😘😍

bestedmmusic
Автор

Sir ! You are great, and aapki videos bhot achhi hai, mene bhot saare tutorials dekhe hai pr aap jesa koi nhi, is playlist ne meri bhot help kri hai C++ ko sikhne me.
Aap is course ko continue kriye, eagerly waiting for your new video on this playlist

madhavpaliwal
Автор

You can set data1 by making a public function in base class which will accept an argument and set that to data 1

priyanshusrivastava
Автор

16:31 answer is yes we can set the data of data1(which is in Base class) in the Derived class.

amitoshdas
Автор

easy understanding of concepts of oops and C++

kaushikchauhan
Автор

harry bia ess course koe app a to z tkk complete krnna...muzze apkki video bhut intresting lgti hee...bakki youtube teachers se...REALLY

ManpreetSingh-nmqd
Автор

I got some problems with inheritance but i don't give up and watched previous video for 5 to 6 times and now i can understand inheritance.thanks harry bhai

parth
Автор

For anyone wondering why we were able to assign a value to data1(an uninherited memeber). When you create an object of a derived class, even if a private member (data1) of the base class is not inherited, compiler still allocates memory to it. That's why calling the setData() function works, since memory has been allocated and now it can change the value stored in that memory to whatever (data1 = 10 ) in this case.

sahilspst
Автор

16:29 As data1 is private so we can't be able to use it outside the class. In that case, we use getfunction() or move the data1 to public instead of private.

AhmedRaza-tyzq
Автор

People getting confused so as to when do we need to use Default constructor or not can refer this:

/*
We need to compulsorily have a default blank constructor in the following cases:

1. Creating an obj such that it is uninitialised at the time of declaration (Not passing parameters to Constructor).
eg- Cricketer C; // creating an unitialised obj of the class Cricketer

2. When a child class is inheriting methods and data members from a parent class, the parent class must contain an empty default constructor.
eg- in above code, its compulsory for class Cricketer to have a default constructor.

*/

/*
We can avoid having a default blank constructor in the following cases:

1. We are initialising our obj at the time of Declaration only.

eg- in above code if we write the following
Coach Rahul("Rahul Dravid");

OR
Coach Rahul = Coach("Rahul Dravid");

Then we don't need to have an empty default constructor

*/

abhinavgarg
Автор

Harry bhaiya great video with clearance
Without lying :- meko constructor ke pehle ke oops meh maja nahi aaraha tha video concept samj aaraha tha orr phir ab inheritance meh orr bhi maja aaraha hai

mohd.irfanlohar
Автор

16:31 can we set another Data1 value
Ans: I think yes by creating base class *Constructor firstly I set Data1 value and data2
And in main I didn't call setdata fxn through derived class object and set another values in constructor thats'it we can set the data of Data1; and use Data1 value in getdata fxn. Without calling setdata fxn.

GeekyShubhamSharma
Автор

Your teaching method is always awesome....It's really rock and thanks for helping students...Keep it up bro...And thank you very much for such kind of

soumyaranjanrout