What do you mean by pure virtual functions?

Answers were Sorted based on User's Feedback



What do you mean by pure virtual functions?..

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

What do you mean by pure virtual functions?..

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

What do you mean by pure virtual functions?..

Answer / sivaramakrishnan

Pure Virtual function is virtual function with expression
equal to zero.
eg
virtual void funct1()=0;

Is This Answer Correct ?    4 Yes 0 No

What do you mean by pure virtual functions?..

Answer / madhu

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

What do you mean by pure virtual functions?..

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

What do you mean by pure virtual functions?..

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

What do you mean by pure virtual functions?..

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

What do you mean by pure virtual functions?..

Answer / azra

which is declare only base class.that is called pure virtual function.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More OOPS Interview Questions

When a private constructer is being inherited from one class to another class and when the object is instantiated is the space reserved for this private variable in the memory??

13 Answers   HCL, Honeywell,


Why is oop useful?

0 Answers  


polymorphism means?

6 Answers   BFL,


What is Iteration Hierarchy? What is what is Object behavioral concept?

1 Answers  


How would you stop a class from class from being derived or inherited.

18 Answers   Ness Technologies,






What are the advantanges of modularity

2 Answers  


what is the difference between class to class type conversion and copy constructor ?

2 Answers  


Name a typical usage of polymorphism

3 Answers  


What do you mean by inheritance?

0 Answers   IBS,


#include <string.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

0 Answers  


wht is major diff b/w c and c++?

10 Answers  


What is multiple inheritance?

9 Answers   TCS,


Categories