Virtual Functions & Abstract Classes in C++ | C++ Programming Tutorials

preview_player
Показать описание
Support Simple Snippets by Donations -
--------------------------------------------------------------------------------------------- In this video tutorial we will study and understand the concept of Virtual Functions and Abstract Classes and we will also see 2 practical examples of Virtual Functions.

Virtual Function in C++ - A virtual function is a member function which is declared within base class and is re-defined (Overridden) by derived class.
When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class’s version of the function.
1) Virtual functions ensure that the correct function is called for an 2) object, regardless of the type of reference (or pointer) used for function call.
3) They are mainly used to achieve Runtime polymorphism
4) Functions are declared with a virtual keyword in base class.
5) The resolving of function call is done at Run-time.

Pure Virtual Functions & Abstract Class in C++ - Sometimes implementation of all function cannot be provided in a base class because we don’t know the implementation. Such a class is called abstract class.
A pure virtual function (or abstract function) in C++ is a virtual function for which we don’t have implementation, we only declare it. A pure virtual function is declared by assigning 0 in declaration. 
Some important facts –
1) A class is abstract if it has at least one pure virtual function.
2) We can have pointers and references of abstract class type.
3) If we do not override the pure virtual function in derived class, then derived class also becomes abstract class.
4) Abstract classes cannot be instantiated.

Simple Snippets Official Website -
Simple Snippets on Facebook-
Simple Snippets on Instagram-
Simple Snippets Google Plus Page-
Simple Snippets email ID-

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

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
Рекомендации по теме
Комментарии
Автор

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 ✌

SimpleSnippets
Автор

Fun Fact :- You don't dare to increase playback speed.

ritikpatil
Автор

Man you are so good at teaching 😊
The way you drop links of your related lectures is so helpful.
Thanks a lot for saving my semester ❤️

zauneebyama
Автор

The way you have explained all the videos on C++ concepts is just awesome. Thank you so much.

anuchechi
Автор

You videos saved my life! I have a test for which I fell asleep and didn’t prepare at all. Thank you! You are doing great :))

rockstarundercover
Автор

Perfect explanation no bs straight to the point and also shows how it is useful, thanks!

aldoalayz
Автор

Tomorrow is my exam and Today I am here for Virtual function.
And my this concept is clear.
Thanks @SimpleSnippets

AdityaSingh-jhqg
Автор

I don't understand how can someone dislike his videos I mean he is so good at explaining and he's better than any of the college teachers! Anyways thankyouuuu so much....

vaidehimahyavanshi
Автор

best video lectures ever seen by mean.
It is the only channel from which i can understand c++ !!
Thank you very much.good work bro!!

bharanikumarpatibandla
Автор

You are videos are life saving one day before exam ☺️ thx a lot dude

soniyagupta
Автор

2 example is very good example to understand the concept of abstract and virtual function

danishpatras
Автор

Damn good 💯. You sound so confident from the start I was like yaa gotchaa. Gotchaa. Finally understood. There was no space for doubt. Thanks man.subscribed.✨

shivanibist
Автор

you got quality in you videos, beautifully explained!! to the point!

manansanson
Автор

I am a intern in a product company and this video really helped me. Osm explenation!

mohansivadhas
Автор

Bhai maza aa gaya! Kya samjhaya hai. Mere University ke teacher se to 100times bawal!!!

gauravkumarverma
Автор

Great work, You have simplified what others complicate most of the time.

kulaningobeni
Автор

Excellent explanation Tanmay. Thanks a lot!!

maheshnahak
Автор

Superb explanation !! it cleared my concept in just 15 mins.. excellent video man ..keep it up bro !!! you will go too far ..all the best

pawarb
Автор

I liked your way of method of teaching😊with good quality of sound...

sathiadak
Автор

plz tell at 13:55 why do we make one extra func...we can do it without it also naa???

hoop