What do you mean by pure virtual functions?
Answers were Sorted based on User's Feedback
Answer / guest
pure virtual function is one which has no definition but
only declaration. This is defined in base class. The
instance of such base class can not be created
| Is This Answer Correct ? | 24 Yes | 3 No |
Answer / manjusinga
A pure virtual function is a function that must be
overridden in a derived class and need not be defined. A
virtual function is declared to be "pure" using the
curious "=0"
syntax:
class Base {
public:
void f1(); // not virtual
virtual void f2(); // virtual, not pure
virtual void f3() = 0; // pure virtual
};
| Is This Answer Correct ? | 16 Yes | 0 No |
Pure Virtual function is virtual function with expression
equal to zero.
eg
virtual void funct1()=0;
| Is This Answer Correct ? | 4 Yes | 0 No |
A pure virtual function tells the compiler that only
declaration is done here and it guarantees that function
definition will be done in the immediate class where object
is created.
It tells the user what it intended to do and without giving
complete details. And the pure virtual function will not
allow the user to create object and leads to abstract class.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / nk
Any class containing any pure virtual function cannot be
used to create object of its own type.
And any class which is derived by such class must either
define the function or redefine the function.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / mx
May the pure virtual function be called by the function
declared and implemented in the base class?
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / prabhakar
A VIRTUAL FUNCTION IS IS EQUALL TO ZERO IS CALLLED A PURE VIRTUAL FUNCTION.
FOR EXAMPLE
VIRTUAL FUN()=0;
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / azra
which is declare only base class.that is called pure virtual function.
| Is This Answer Correct ? | 0 Yes | 3 No |
Plese get me a perfect C++ program for railway/airway reservation with all details.
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is a null tree?
How to overload new operator in c++
why oops need in programming
Why u change company?
what is data abstraction with example.
What is inheritance and how many types of inheritance?
to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123
what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.
What does and I oop and sksksk mean?
how to find the largest of given numbers in an array