Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

hi all..i want to know oops concepts clearly can any1 explain??

0 Answers   Eureka Forbes,


what is overloading and overriding?

7 Answers  


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

2 Answers  


#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; a.x = 22; int c = a.x; int *b = new int; cout << c; return 0; } option: No output 0 22 -(11) Will not compile

1 Answers   CTS, Wipro,


what is polymorpsim? what are its types?

8 Answers  


What is an object?

14 Answers   HCL,


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

1 Answers  


Why is polymorphism important in oop?

0 Answers  


#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

0 Answers  


what is the difference b/w abstract and interface?

2 Answers   Merrill Lynch, Schneider, Scio Healthcare,


the difference between new and malloc

5 Answers   Siemens,


When is a memory allocated to a class?

11 Answers  


Categories