What are the difference in inheriting base into derived and creating an object of base inside derived ? Can u please provide Differences in their construction (constructor call)and memory allocation and other things if they exits
I have a video on this topic please check that once (IS-A and HAS-A Relationship). If further doubts we can discuss . Link: th-cam.com/video/gHiURx5Hby8/w-d-xo.html
@@CppNuts watched that video Now I know that both the relationship uses same memory allocation and same sequence of construction and destruction. We we can't use them interchangeably right? What are the situation where it makes difference.
Hello Below is a function from a class called Container, now I know that I am giving you less to work with but I would appreciate it if you were to cover something called delegation. I understand that it is something of the syntax below, especially the 'end' colon then calling another function... Container::Container(const Container& objOrig) : Container(objOrig._size) I hope you understand what I am trying to convey and I would appreciate your help.
I put cout to the constructors. While not using the virtual keyword, declaring an instance of class Rupesh, Human Constructor is called only once. However, in the video you are saying that it creates Human twice. How could that be possible?
When there is a virtual inheritance then compiler knows that how to deal with it. Actually human is created only once and its pointer is copied to TH-camr class Engineer class and Rupesh class. So that they all can to one single Human class. I hope this would help!!
Helped me a ton . Thanks
Glad it helped!
What are the difference in inheriting base into derived and creating an object of base inside derived ?
Can u please provide Differences in their construction (constructor call)and memory allocation and other things if they exits
Sure will try!!
@@CppNuts thank u sir
And if u don't get time any soon plz do text a text reply about it plz
I have a video on this topic please check that once (IS-A and HAS-A Relationship).
If further doubts we can discuss .
Link: th-cam.com/video/gHiURx5Hby8/w-d-xo.html
@@CppNuts watched that video
Now I know that both the relationship uses same memory allocation and same sequence of construction and destruction.
We we can't use them interchangeably right?
What are the situation where it makes difference.
Hello
Below is a function from a class called Container, now I know that I am giving you less to work with but I would appreciate it if you were to cover something called delegation. I understand that it is something of the syntax below, especially the 'end' colon then calling another function...
Container::Container(const Container& objOrig) : Container(objOrig._size)
I hope you understand what I am trying to convey and I would appreciate your help.
I have video on constructors delegation. Please try that one.
@@CppNuts
Thank you so much, your work is highly appreciated.
I put cout to the constructors. While not using the virtual keyword, declaring an instance of class Rupesh, Human Constructor is called only once. However, in the video you are saying that it creates Human twice. How could that be possible?
Can anyone Kindly tell the name of this compiler?
Vscode or sublime text editor
u are Lengend😘
No i am not but, thanks for your love.
How virtual keeps only one human class in rupesh class
When there is a virtual inheritance then compiler knows that how to deal with it. Actually human is created only once and its pointer is copied to TH-camr class Engineer class and Rupesh class.
So that they all can to one single Human class.
I hope this would help!!
@@CppNuts thanks
Rupesh is coder not human..hahaha
just kidding
haha..