Explain what pure virtual functions are what an abstract cla

Explain what pure virtual functions are, what an abstract class is, and how they both relate to dynamic binding and polymorphism.

Solution

Pure virtual functions

A virtual function is specified pure by using a pure-specifier (=0) in the function declaration in the class definition.

Abstract class

An abstract class is a class that can be used only as a base class of some other class;
A class is abstract if it has at least one pure virtual function.

How they both relate to dynamic binding and polymorphism.

we need to happen is for the binding to be delayed until run time so that the correct type of object can be determined.

In order to accomplish \"run-time\", \"late\", or \"dynamic\" binding we must use virtual function

Explain what pure virtual functions are, what an abstract class is, and how they both relate to dynamic binding and polymorphism.SolutionPure virtual functions

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site