what is the difference between virtual function and
destoctor?

Answer Posted / prabhakar

virtual function is just like a member function of a class.it is used to over loading mechanisam.it can be acesses by any object of either base class or derived class.
destructor is used to dellocate the memory of an object.it can call by using delete operator.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does and I oop mean in text?

614


What is encapsulation example?

541


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

2157


What causes polymorphism?

563


What do you mean by variable?

567






Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

687


Can abstract class have normal methods?

600


What is oops?what is its use in software engineering?

550


What is a superclass in oop?

662


Is enum a class?

598


What is abstraction oop?

615


is there any choice in opting subjects like 4 out of 7

1725


Whats oop mean?

583


Which method cannot be overridden?

572


Why is destructor used?

574