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

Answer Posted / sachinmundhra

vptr gets initialize in constructor. So in that case we
cannot have virtual constructor.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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.

709


class type to basic type conversion

1845


What is solid in oops?

618


Why do we use oop?

609


What is interface? When and where is it used?

1669






What is class and object with example?

593


What is object and example?

608


What are the benefits of polymorphism?

630


Why is object oriented programming so hard?

618


Why is oop useful?

608


What is abstraction example?

630


What is interface in oop?

668


What is byval and byref? What are differences between them?

1698


Can bst contain duplicates?

682


What is abstraction oop?

629