answersLogoWhite

0

The lazy way is to use a dynamic cast. The correct way is to use virtual functions in the base class. That way you don't ever need to know the derived type -- it simply does what is expected of it.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Where can I find the keyword "nowhere" used in a sentence?

You can find the keyword "nowhere" used in a sentence in a dictionary or by searching for examples online.


How java use extern key word which is used in C plus plus?

No extern keyword in Java.


What is the purpose of finding derivative?

The purpose of finding a derivative is to find the instantaneous rate of change. In addition, taking the derivative is used in integration by parts.


Is it possible to declare a keyword as an identifier in c plus plus?

No. Keywords are reserved and cannot be used as identifiers. However, C/C++ is case-sensitive. So although register is a reserved keyword, Register is not.


Why derivative is taken?

Derivatives are used to find instantaneous rate at which a function changes.


What are the differences between a keyword and a plate?

A keyword is a word or phrase used in a search engine to find relevant information, while a plate is a flat dish used for serving food.


What is the find command used for?

The find command is a means of find a "keyword" in a document.


Which equation is not used in the derivation of the keyword?

The equation that is not used in the derivation of the keyword is the quadratic formula.


Can both the keyword and the question be used for three"?

Yes, both the keyword and the question can be used for three.


Is in is used as a keyword in C language?

Neither "in" nor "is" is a keyword in C.


What is a keyword marketing tool used for?

A keyword marketing tool is used to increase organic traffic by focusing on the most promising keywords. The more a keyword is used by searchers and websites the more attraction it receives.


Can keyword be used as variables?

No, any keyword could be used as a identifier (a method, class or variable name). These keywords have a special meaning in the language and the compiler can not identify if they are used as a variable name or as a keyword,