After a long time........... Really appreciate your videos.
@CppNuts4 жыл бұрын
Thank you so much 😀
@treyquattro4 жыл бұрын
Always good to see new videos from Rupesh! Virtual is a very important topic in C++
@CppNuts4 жыл бұрын
Correct!!
@treyquattro3 жыл бұрын
@Seth Trenton no, no-one gives a shit about your lies and malware
@mockingbird38094 жыл бұрын
Great video as always, Cppnuts! ;)
@CppNuts4 жыл бұрын
Thanks dude...
@amitpaunikar34084 жыл бұрын
After long time.....good explanation
@CppNuts4 жыл бұрын
Thanks..
@mohanrajawat65083 ай бұрын
such a wonderful video over the complex topic like virtual
@bimalthapaliya71344 жыл бұрын
Sir, please make a video on pointer to object and object to pointer! We are getting lots of confusion in that portion! PS- always loved your work! Thank you for this series!
@rajeshsola17764 жыл бұрын
Hi, Thanks for sharing great videos, i think one statement can be fine tuned...Instead of saying virtual functions can be called with pointers and references only (which implies can't be called by objects), we can say that if we call with objects directly it'll go by static binding and won't get benefits of runtime polymorphism (or) to get the benefits of dynamic behavior call by pointer/reference..please see
@CppNuts4 жыл бұрын
Thanks man, but did i said this? I think i always added dynamic word with that line.
@ManishPatel-dj7eb3 жыл бұрын
Nice informative video, It explains all details in easy way. thanks Q1. Which editor you are using ?
@sureshonteru46094 жыл бұрын
Hi Rupesh Thanks a lot for the video , still I have a doubt why Base * b = derived () It's calling base class method, what happens it's storing derived class address but it's calling base class method ,what happens inside and compile time . can you explain
@raghuj70974 жыл бұрын
Super...after a long time...we are happy to see
@CppNuts4 жыл бұрын
Thanks..
@yashsaxena46344 жыл бұрын
Thanks for making it simple.
@CppNuts4 жыл бұрын
Glad it was helpful!
@hunnybunny4723 Жыл бұрын
So what exactly is the use of this virtual functions concept? In what way is it useful in the real world scenario? We can call derived function by creating derived object ryt, what exactly the need of calling through the base class pointer?
@ravishsga4 жыл бұрын
Good to see you back Rupesh :) Just one question in which scenario we need to call the derived function with the base class pointer? Why we are making the base class pointer point to the derived object?
@CppNuts4 жыл бұрын
If you want to create an array of different objects you can make their parent common and have array of pointers of those different object and do some operations on a single array. Let me know if this is not clear, actually I wanted to explain this also in video that why do we need that but I didn't actually find the good example for this.
@hritik48072 жыл бұрын
@@CppNuts not clear , can you make a video :)
@priyaldesai82902 жыл бұрын
Hi, Thank you for sharing the video. Can you please share the link for following vptr and vtable video as well.
@CppNuts2 жыл бұрын
I prepared notes to teach but i lost it somehow and still i didn't feel like redoing that notes, that was like so much hard work.. Hope i may find courage to redo it and shoot the vid.
@mansokash22153 жыл бұрын
very good explanation, thank you, keep them like this detailed
@abhaybajpai94693 жыл бұрын
Very Informative video....thanks a lot.....again!!!😁
@CppNuts3 жыл бұрын
Welcome..
@vvpChannel31124 жыл бұрын
What if we have a data member in base class lets say float f=1.2; So, can we access b->f iff Base *b = new Derived ?
@CppNuts4 жыл бұрын
Yes..
@sharath57963 жыл бұрын
u have to declare that data member as protected ig
@ahmedajbna48043 жыл бұрын
Thank you so much. I was very confused, now I got it.
@CppNuts3 жыл бұрын
Welcome..
@abhinavkumar5624 жыл бұрын
I hope that you will continue the dsa series...
@CppNuts4 жыл бұрын
Sure man..
@bhupeshpattanaik71504 жыл бұрын
Thanks ☺️ .... Please guide for competitive coding using CPP
@CppNuts4 жыл бұрын
Sure dude.. Let's complete virtual topic first.
@bhupeshpattanaik71504 жыл бұрын
@@CppNuts ya please that soon ..... Very curious to start
@Vicky-xi9ns4 жыл бұрын
Thanks for your c++ series
@CppNuts4 жыл бұрын
Glad you like them!
@AJAYKUMAR-gl1vx2 жыл бұрын
class Base{public: virtual f(){}}; class Derived:public Base{public: f(){}}; int main(){Derived d; Base b=d; d.f(); return 0;} Here f() will be early binding or late binding??
@vishalchoudhary2913 Жыл бұрын
9:50 Please correct you can give body to pure virtual function.
@CppNuts Жыл бұрын
Yes we can give body to pure virtual function.
@ArjunArjun-vw5fq4 жыл бұрын
congrats for 28k.
@CppNuts4 жыл бұрын
Thanks bro..
@AJAYKUMAR-gl1vx2 жыл бұрын
Hi 😊 Can you please explain, why pointer or reference variable is required for late binding?
@CppNuts2 жыл бұрын
Because late binding itself tells that I will be available later, and what ever comes later you have to work on that and this later thing is handled using pointer or reference, because later only these two make sense. In case of static (current, not the late) meaning you already have the object on which you will work.
@AJAYKUMAR-gl1vx2 жыл бұрын
@@CppNuts Thank you 😊
@Jam181238 ай бұрын
very informative, thank you
@mohammadjadidi2333 жыл бұрын
Really appreciate your videos....
@CppNuts3 жыл бұрын
Thanks..
@shirishareddy27953 жыл бұрын
why can only achieve polymorphism(virtual function) through pointers or references,but not through object assignment. pl z solve my doubt sir
@ranjanrajesh082 жыл бұрын
Hi Rupesh, i tried coding using reference concept for virtual polymorphism…it is not working exactly the same way…i mean to say using reference if i try to call the fn…by removing virtual keyword in base class, then also last overridden fn gets called instead of base class fn
@CppNuts2 жыл бұрын
Give me the code plz.
@ranjanrajesh082 жыл бұрын
@@CppNuts hey Rupesh…my mistake…i must have been doing some mistake…I tried to run the code again and i see it is working as expected…Thanku Rupesh😊
@SunilDevadiga-u6q3 ай бұрын
Cracking interview is much easier if we watch your all cpp videos, Thanks for your knowledgeable videos. one help please - I didnt find Vtable and Vpointer explanation video - Can you please help on this?
@CppNuts3 ай бұрын
Thanks man, I had prepared for that video and then somehow with time I lost all the materials, but don't worry I will try to collect it back and push this video asap.
@chitranshsaxena593 жыл бұрын
Hey, nice video, maybe you can also explain about vtables and stuff
@lifeisacelebration72334 жыл бұрын
Volume is bit less for all videos.
@CppNuts4 жыл бұрын
Correct, i try to avoid noise, so it become like that, i will work on this sound issue. Thanks..
@lifeisacelebration72334 жыл бұрын
@@CppNuts thank you for all the tutorials
@CppNuts4 жыл бұрын
You are welcome..
@rachitaa._24 күн бұрын
Really helpful
@prasadsolleti387010 ай бұрын
Sir please explain one real time example code in virtual function and pure virtual function
@adityavaste37323 жыл бұрын
That was so an amazing tutorial... But I have one doubt, that why we are saying it as "Run-Time Polymorphism", bcz compiler can easily decide which function he has to call, as we are using "virtual" keyword there, So, at a compile-time, he knows that, "We don't have to call the function in the base class bcz it is using virtual keyword, and we have to call the function from the derived class with the same name", that's simple........... he can easily decide at a compile-time, why he goes with run-time?
@CppNuts3 жыл бұрын
But it can call base class function also.. that's the point. Base pointer can contain either base object or derived object if it is containing derived object in that case it will call derived class function or if it is holding base class object then it will call base class function. That's why it is run time behaviour because base pointer can contain either base object or derived object so we really don't know no what object it is going have till run time.
@jilmon34982 жыл бұрын
Virtual table ?? Video?
@prishaphotography90634 жыл бұрын
Nice👍
@CppNuts4 жыл бұрын
Thanks ✌
@NolstanLogic3 ай бұрын
wabwera
@nikhilkhatri97212 жыл бұрын
*I don't want to become animal!!*
@CppNuts2 жыл бұрын
Good
@Mani--ck3xc Жыл бұрын
hi @CppNuts i am getting this error cannot find virtual: No such file or directory , c:/users/mani.chaitanya.konka/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find virtual: No such file or directory c:/users/mani.chaitanya.konka/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find function: No such file or directory