Relationship between Virtual Functions, Pure Virtual Functions and Abstract Classes in OOP explained

preview_player
Показать описание
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️

Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

In this Object-Oriented Programming course, I'm explaining the relationship and purpose of virtual functions, pure virtual functions, and abstract classes.

C++ Virtual functions are functions defined in the base class and redefined in the derived class, whose main purpose is achieving runtime-polymorphism. Virtual functions are defined with the "virtual" keyword in the base class. You can find a detailed explanation and an example in this video, and I'll also show you how the runtime polymorphism achieved by using virtual functions looks like.

Pure virtual functions in C++ (abstract function) in C++ is a virtual function for which we don't write implementation in the base class, but we only declare it. In order to declare a pure virtual function, you need to assign 0 in the declaration

Abstract class in C++ is a class that has at least one pure virtual function. The classes which inherit the abstract class must provide a definition for the pure virtual functions, otherwise, they would be abstract themselves and you wouldn't be able to instantiate them.
The main purpose of an abstract class is to provide an appropriate base class from which other classes can inherit.

However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇

Contents:
00:00 - Into
01:21 - Virtual Functions
12:21 - Pure Virtual Functions and Abstract Classes
17:28 - Polymorphism example

🎹 Fun fact, on my language accordion is called "Harmonika" like the word harmony.

Tag me on you Instagram stories:
Рекомендации по теме
Комментарии
Автор

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

CodeBeauty
Автор

None of my University teachers were able to made programming look so easy like you do. Good job on being such a great teacher!

MarianSyFy
Автор

The fact that you decided to keep the nostalgia you got apart of this video shows how much effort you put into these thank you so much for these videos <3 They help me a lot

adithyasankar
Автор

Finally someone who explains things as simple as they are and does not complicate them. Thanks

uwelab
Автор

Oh girl you are blowing my professors and teachers out of the WATER 😭😭😭😭 bless your soul queen 🙌🙌😭😭 I hope you make it to heaven

nothingiseverperfect
Автор

Thank you so much for this video, I just got my first tech job as a C++ developer, and the only C++ questions during the interview were about virtual functions, so you helped me get the job!

Boba
Автор

I'm always amazed how this OOP videos can summarize 1 week of formal programming courses.
They are rudimentary, but an ideal start.

Lordcarlox
Автор

I listened to 25 accordion compositions on the link with affection. Very beautiful music.

ordinary_man_
Автор

YOU ARE AN AMAZING TEACHER. I dont need to check for someone else's tutorial. I am always sure that your tutorial is all I need to understand OOP.

hamzah
Автор

Thank you for teaching the world C++ in logical, bite-size chunks! I am a longtime C programmer and am just getting up to speed on C++. Your course is helping me do that with minimum effort. I was prompted to leave a comment because I too played the accordion when I was young and I too miss playing it!

michaelisnardi
Автор

Leterally u can beat any professor in teaching skills.

notappi
Автор

I watched many c++ tutorials and this was the first video I watched that I allowed me to understood this concept! Thanks!

michaellundgren
Автор

I just loved how clear and confident you are while teaching, pleased that I've found your channel♥️😊

-_-
Автор

This teacher has a great art of simplifying things such that even a new student is able to take out the core meaning from her session. Good Job teacher

sahibpreetsingh
Автор

your way of teaching also like pure virtual function forces me to understand the topic easily.😁thank you so much.

niteshkoli
Автор

Thank you Sensei! You taught me passion, patience, precision, peace and Abstract Classes. 🙏 🙇

hazaonly
Автор

And here I was studying and now I just got sidetracked by the accordions... I don't regret it. Thanks for your invaluable help in the videos! You truly have a deep knowledge and talent in teaching programming! Keep up the great work!

adhel-estebanriverarodrigu
Автор

I learned all the C++ concepts I was struggling to learn in university with your videos that teach them as simple as they are and not unnecessarily complicate them. Thanks for the amazing toturials :)

arashghasemi
Автор

As an electonics engineering student, I love u r tutorials. Thanks for your nice explanation. greetings from Turkey :)

satranc_kaplani
Автор

I was so daunted by what this topic had in stored but you made it really simple to comprend. I appreciate you and your value to the coding community. Thank you !!!

anmolnuri
welcome to shbcf.ru