C++ Abstract base classes and pure virtual functions [7]

  Рет қаралды 4,095

Professor Hank Stalica

Professor Hank Stalica

Жыл бұрын

You cannot create an instance of an abstract base class, but you can create other classes that are derived from it. A pure virtual function is a virtual member function that belongs to a base class and needs to be redefined in derived classes. When a class has a pure virtual function as a member, it becomes an abstract base class.
Learn how this works through writing sample classes in this C++ tutorial for beginners written with Visual Studio 2022 C++ .
// Join the new Programming for Everyone Community Forum:
professorhank.freeforums.net/
// Learn More //
The Inheritance, Polymorphism,and Virtual Functions play list:
• CH15: Inheritance, Pol...
// Consider supporting this channel in multiple ways
paypal.me/hankstalica1
Bitcoin: 177wfkQwzXiC8o2whQMVpSyuWUs95krKYB

Пікірлер: 20
@brotherkingbig981
@brotherkingbig981 4 ай бұрын
Thank for your teaching. I think your teaching is better our professor
@ProfessorHankStalica
@ProfessorHankStalica 4 ай бұрын
Wow, thanks
@Towhid-ze3rw
@Towhid-ze3rw Ай бұрын
Now this concept is my academic weapon for the OOP theory exam. Loved it
@guillaumelacroix4436
@guillaumelacroix4436 Ай бұрын
thank you so much for this explanation of pure virtual functions!
@ProfessorHankStalica
@ProfessorHankStalica Ай бұрын
Glad it was helpful!
@user-md8fg9sg8c
@user-md8fg9sg8c 4 ай бұрын
thanks ,I found it an useful explaining simple video
@ProfessorHankStalica
@ProfessorHankStalica 4 ай бұрын
Glad to hear that!
@qcnck2776
@qcnck2776 Жыл бұрын
Sometimes, bacon and eggs is just foo. 🙃Sometimes, its very tasty. Nice class names!
@ProfessorHankStalica
@ProfessorHankStalica Жыл бұрын
😆🍻
@robo-
@robo- 3 ай бұрын
excellent videos, thanks so much :)
@ProfessorHankStalica
@ProfessorHankStalica 2 ай бұрын
Glad you like them!
@lg7t
@lg7t 21 күн бұрын
so professor is this is the last oop video or there is a future playlist ? and thank you very much for these videos .
@chevlonmacguinstudios
@chevlonmacguinstudios Жыл бұрын
Love your content hank, is there anyway you could use AI to show examples where it makes mistakes or why it's important to utilise it's advantages
@ProfessorHankStalica
@ProfessorHankStalica Жыл бұрын
Thanks tons for the comment. I am planning to do some more stuff with A.I. in the future, but haven't been able to get to it yet. It's on the stack of stuff though. In the meantime, I do have an A.I. play list I used for my classes at CSUEB. You can find some answers to your questions in those videos, at least implicitly.
@alexandruteodor3585
@alexandruteodor3585 Жыл бұрын
Hi! I don't understand why you made the print function virtual in the derived classes.
@ProfessorHankStalica
@ProfessorHankStalica Жыл бұрын
You don't have to do so. I do so out of habit to remind me that it is a virtual function in case I want to use the class as a base class for other classes. Basically as a form of documentation. You absolutely don't have to though.
@hlubradio2318
@hlubradio2318 4 ай бұрын
Hmm never seen virtual functions and that const before
@velvethamster9809
@velvethamster9809 3 ай бұрын
virtual keyword in a function within class means, that function can be overridden by its derived classes. const keyword after the function parameter within a class means the function can not modify its class members.
@hlubradio2318
@hlubradio2318 3 ай бұрын
@@velvethamster9809 what
@velvethamster9809
@velvethamster9809 3 ай бұрын
@@hlubradio2318 ?
C++ Polymorphism and Virtual Member Functions [6]
12:13
Professor Hank Stalica
Рет қаралды 10 М.
C++  Tutorial: Rule of 5  [move constructor, move assignment operator]
29:46
Professor Hank Stalica
Рет қаралды 16 М.
ВОДА В СОЛО
00:20
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 33 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 53 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 14 МЛН
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 921 М.
Virtual Functions & Abstract Classes in C++ | C++ Programming Tutorials
15:12
Dynamic Binding (Polymorphism) With The Virtual Keyword | C++ Tutorial
9:57
Interfaces in C++ (Pure Virtual Functions)
6:55
The Cherno
Рет қаралды 344 М.
C++ std::function Next Level Function Polymorphism 👨‍💻
9:07
Interfaces - C++ programming practice
12:37
Rachel Wil Singh
Рет қаралды 22 М.