What is a 'pure' virtual function and what's its use?
Answer / phool chand
A pure virtual function is signified by using `=0;' in place of the body of the function. The presence of a pure virtual function prevents instantiation of the class which contains it. For this to be of any use, a derived class must implement the pure virtual function. I.e. the derived class must provide a function with the same name which includes a function body.
The basic reason for pure virtual functions is to specify something that a class can do without specifying how the class will do it.
| Is This Answer Correct ? | 0 Yes | 0 No |
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What are static variables?
What is c++ used for in games?
Describe private, protected and public – the differences and give examples.
Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.
What is class definition in c++ ?
How do you print for example the integers 3,2,1,5,4 in a binary tree within the console in format where it looks like an actual binary tree?
Which function cannot be overloaded c++?
What is format for defining a structure?
How many types of classes are there in c++?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What are punctuators in c++?