What is Pure Virtual Function? Why and when it is used ?
Answer Posted / ognas(shradha-asutosh)
in inheritance if the base class contains a virtual
function equating to zero, it is known also as do-nothing
function & that base class is called as abstract base class
as there are no instances or objects can be created by this
base class. And this pure virtual can be filled with the
codes in successiv derived classes accordin to the user
requirements.
The syntax of the pure virtual function is....
class class_name
{
visibility mode:\\should be protected:
virtual return_type function_name()=0;
}
new class_name : inheritance_type old class_name
{
........ //class body
........
}
Is This Answer Correct ? | 69 Yes | 19 No |
Post New Answer View All Answers
What is ofstream c++?
What is searching? Explain linear and binary search.
What is called array?
True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
When can I use a forward declaration?
There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.
How do we balance an AVL Tree in C++?
What is anonymous object in c++?
Is overriding possible in c++?
Can I create my own functions in c++?
What is the fastest c++ compiler?
What is the use of dot in c++?
Does c++ have string data type?
Mention the ways in which parameterized can be invoked. Give an example of each.