Explain pure virtual functions?
Submitted by: MurtazaPure virtual functions are also called 'do nothing functions'.
e.g. virtual void abc() = 0;
When a pure virtual fnction is declared in the base class, the compiler necessitates the derived classes to define those functions or redeclare them are pure virtual functions. The classes containing pure virtual functions cannot be used to declare objects of their own. Such classes are called as abstract base classes.
Submitted by: Murtaza
e.g. virtual void abc() = 0;
When a pure virtual fnction is declared in the base class, the compiler necessitates the derived classes to define those functions or redeclare them are pure virtual functions. The classes containing pure virtual functions cannot be used to declare objects of their own. Such classes are called as abstract base classes.
Submitted by: Murtaza
Read Online C++ Inheritance Job Interview Questions And Answers
Top C++ Inheritance Questions
☺ | What is a base class? |
☺ | Explain protected inheritance? |
☺ | Do you know private inheritance? |
☺ | Explain Private Inheritance? |
☺ | Explain the advantages of inheritance? |
Top C Plus Plus Language Categories
☺ | C++ Pointers & Functions Interview Questions. |
☺ | C++ Operator Overloading Interview Questions. |
☺ | C++ Exception Handling Interview Questions. |
☺ | C++ Virtual Functions Interview Questions. |
☺ | C++ Template Interview Questions. |