1.

What Do You Understand By Pure Virtual Function? Write About Its Use?

Answer»

A pure virtual function in a base CLASS must have a matching function in a derived class. A program MAY not declare an instance of a class that has a pure virtual function. A program may not declare an instance of a derived class if that derived class has not provided an OVERRIDING function for each pure virtual function in the base. If you WANT PROGRAMMERS to override certain functions in a class, such as those that need information customized for a particular installation, you should make these functions pure virtual.

A pure virtual function in a base class must have a matching function in a derived class. A program may not declare an instance of a class that has a pure virtual function. A program may not declare an instance of a derived class if that derived class has not provided an overriding function for each pure virtual function in the base. If you want programmers to override certain functions in a class, such as those that need information customized for a particular installation, you should make these functions pure virtual.



Discussion

No Comment Found