filmov
tv
Pure Virtual Functions in C++ | C++ Programming tutorials for Beginners
![preview_player](https://i.ytimg.com/vi/gtkh3KxcX4U/maxresdefault.jpg)
Показать описание
Support Simple Snippets by Donations -
--------------------------------------------------------------------------------------------- In this video tutorial we will study and understand the concept of pure virtual functions in c++ and also see an example of prure virtual functions in terms of practical code.
Pure Virtual Functions 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 –
A class is abstract if it has at least one pure virtual function.
We can have pointers and references of abstract class type.
If we do not override the pure virtual function in derived class, then derived class also becomes abstract class.
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
--------------------------------------------------------------------------------------------- In this video tutorial we will study and understand the concept of pure virtual functions in c++ and also see an example of prure virtual functions in terms of practical code.
Pure Virtual Functions 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 –
A class is abstract if it has at least one pure virtual function.
We can have pointers and references of abstract class type.
If we do not override the pure virtual function in derived class, then derived class also becomes abstract class.
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
Комментарии