|
|
|
|
|
by AnimalMuppet
3970 days ago
|
|
> Type casting, which converts one type of an object to another, plays an essential role in enabling polymorphism in C++ because it allows a program to utilize certain general or specific implementations in the class hierarchies... What? No. C++ polymorphism doesn't work based on type casting, it works based on virtual functions. Type casting would mean you were using some kind of "switch on type" scheme. That's not polymorphism. That's what polymorphism is supposed to replace. |
|