What is Pure Virtual Function? Why and when it is used ?

Answer Posted / harry

pure virtual function declared in the base class.
pure virtual function having intializer=0;
pure virtual function also know as do nothing function &
dummy function.
class contain atleast one pure virtual function.
object cannote be create of that class in which pure
virtual function are declared and that class are know as
abstract class.

Is This Answer Correct ?    15 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c or c++ more useful?

574


What is the real purpose of class – to export data?

616


What is the difference between reference and pointer?

610


How do you find out if a linked-list has an end?

645


What is scope resolution operator in c++ with example?

553






What is the difference between *p++ and (*p)++ ?

776


How to give an alternate name to a namespace?

591


What is the limitation of cin while taking input for character array?

1453


How do you flush std cout?

566


What is code reusability in c++?

664


What is the difference between structures and unions?

580


What are virtual constructors/destructors?

578


What is double in c++?

559


how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include //INCLUDE EVERY KNOWN HEADER FILE #include //FOR ANY CASE... #include #include #include main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<

1810


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

560