Pure Virtual Function In C++
Vložit
- čas přidán 29. 08. 2024
- JOIN ME
-----
CZcams 🎬 / @cppnuts
Patreon 🚀 / cppnuts
COMPLETE PLAYLIST
------------
C++ Tutorial For Beginners: • Introduction To C++
STL (Standard Template Library): • STL In C++
ThreadIng In C++: • Multithreading In C++
Data Structures: • Data Structure
Algorithms: • Binary Search
Design Patterns: • Factory Design Pattern...
Smart Pointers: • Smart Pointer In C++
C++14: • Digit Separator In C++
C++17: • std string_view in C++...
C++ All Type Casts: • static_cast In C++
INTERVIEW PLAYLIST
------------
C++ Interview Q&A: • Structural Padding & P...
C++ Interview Q&A For Experienced: • How delete[] Knows How...
Linked List Interview Questions: • Find Kth Node From Bac...
BST Interview Questions: • Search Element In Bina...
Array Interview Questions: • Reverse An Array
String Interview Questions: • Check String Is Palind...
Bit Manipulation Questions: • Find Set Bit In Intege...
Binary Tree Interview Question: • Invert Binary Tree
Sorting Algorithms: • Bubble Sort
C++ MCQ: • Video
C MCQ: • What printf returns af...
C Interview Questions: • Designated Initializat...
QUICK SHORT VIDEOS
-------------
C++ Short : • C++ Short Videos
C Short : • Shorts C Programming MCQ
Pure Virtual Function
SYNTAX: virtual returntype functionname(parameters...) = 0;
NOTES:
0. If some class can have only signature of function but not the body then we use pure virtual functions.
1. Sometimes in Base class we know the function name but not the definition of the function, so we want Derived classes to provide the definition of the function.
2. We can actually give body of pure virtual function.
3. If you have pure virtual function in your class, it means that class is an Abstract class and you can't create an object of that class. (But pointers and Reference can be created)
USE CASE:
1. Used to create abstract classes, which helps in creating interfaces (APIs)
#cpp #virtualfunction #programming #coding #softwareengineering
Your CPP series is just a lifesaver!
Thanks man..
One of the best explanations I have found here regarding intimidating C++. Learned a lot from your content. My best wishes to you.
Thanks dude..
Even a pure virtual function can have definition, I was not knowing this. Thank you sir. Your videos are just amazing. Keep on posting videos related to C++ Sir.
Good to know this.
I didn't know that we can define pure virtual function in base class...Thank you
Glad it was helpful!
Amazing…I didn’t know we can give body for pure virtual fn…your tutorials are amazing n there is always something new to learn from your videos even after knowing the concepts🙏🏻
More likes and subscriber you should have... very clear and crisp explanation at right pace...
I didn't knew it..
Thank you so much for this channel and knowledge sharing.
More power to you ✌
Most underrated channel brother for the kind of explanation you give
Thanks brother
9:43 you absolutely deserves "like" for this and yes you got it!
Thanks man...
gyan ka bhandar you are best !!
My pleasure.
A pure virtual function can have definition, I was not knowing this. Thank you sir.
After a long time 😁
Yes.. 😀
Thanks a lot for the new Year video. Its been quite long to see you man, How are you doing. HNY 2021. Learnt a lot form your video series. Please keep posting videos on System design, OOD Design as well as these are quite a market boom topic for the FANG! .Thanks
Sure man .
i didn't knew body of pure virtual function. thanks
Glad it helped..
much better then code with harry c++ tutorial vdo
thnk you sir
Thanks man..
i'll definitely support you on patreon !!
Thanks dude..
Great information
Good to see you're back 😊
Thanks man..
The animls who eat( veg) only = herbivores,
Who eat (non veg )= carnivores,
Who eat both =omnivores.
Thanks brother
Thanks, Bro for Knowing us new things
thank U very much !!! I will comment :)
This was new for me
I loved this stuff...
Thanks man..
U r awsm really 🥰
Thanks man..
i didn't knew that.. thankss :)
Happy to help!
Can we have a series on Socket Programming ...?
Good One, Sir Why Reference is created of abstract Class while reference is just alias name ?
Can you do a video on virtual table and vptrs
Sure..
Hey Rupesh,
Thanks for the video.
Can you please make one video covering vtable and vptr topic only.
Thanks
More power to you ✌
Sure man..
Dear sir, concept of virtual functions holds same for virtual class also like vptr and vtable? Could you plz give us idea on virtual base class internal working like diamond problem?
Sir please make a video on vptr and vtable
After a long time. Welcome back.
By the way your voice changed a bit heavy tone.
Thanks man..
Sound would be an issue, i am not using my own setup, it's my brother's.
@@CppNuts to answer your question: yes, I always thought that pure virtual function doesn't have a body lol. I was wrong.
Nicely explained!
Glad it was helpful!
If we define the definition to pure virtual function, it means that definition behaves as default and changed in child classes if required ??
But default means it should be able to be called if Derived class is not providing that definition but that's not the case here. Actually Derived class have to provide the definition otherwise we can't create the instance of Derived class. Hope you got it!!
Let me know if you need more help..
any video you have for vtble and vptr ?
But vptr n virtual table concepts are not covered in this series
why u have not uploaded more videos on virtual function
Actually i had prepared to shoot and then somehow i lost my notes, then this is postponed, i will plan quickly, as so many people are demanding this.
bhai content 1 number hota h tumhara bus advertisment thodi kam kar lo focus kharab ho jata h
Ok..
I will take care next time.
Thanks man..
How did you call Animal::move in derived class which is not static function.
that snake is a snack (✿◠‿◠)
@CppNuts what do you prefer Joining your Pro on youtube or donating on your patreon??? .......... I will do whichever You want...
Hi @Vaibhav I would prefer patreon as its processing charges are less.
Thanks for considering..
Hey Rupesh , after long time . What happened any problems there. Thanks for uploading.
No issue, I am at hometown so delayed.
Thanks for asking.
🔥
😳I was not knowing that
😀 honest..
I am not able to find your video on virtual table and virtual pointer
It's because i have not given that yet.
will push in few days.
i got my setup back.(back to Banglore)
@@CppNuts Thanks, I will wait for the same :-)
I knew
I don't know that pure virtual function body can be created
❤
I didn't know that
Glad to you..
that's how interfaces work in C++. I'm a java guy
Yes.. :D
Is no body gonna mention 'Snack'?
i am here after a year
its snake not snack
don't know thanks
Welcome..
@@CppNuts can we see back tracking problems