Definitions

Static typing means determining the exact type of a variable when the program is compiled. It is the default typing mechanism in C++. Note that this has no particular relation to the keyword static.

Dynamic typing means delaying the determination of the exact type of a variable until run time rather than fixing that type at compile time, as in static typing.

Polymorphism, one of the major organizing principles in C++, allows us to implement several classes with the same interface and treat objects of all these classes as though they were of the same class. Polymorphism is a variety of dynamic typing that maintains the safety factor of static type-checking, because the compiler can determine at compile time whether a function ...

Get Learning to Program in C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.