c++ - Why Casting feature? -


i new c++. beginner. while learning casting feature provided c++, wondering why casting feature specially static cast. when know type of variable required why casting?.

if understand question correctly, asking why there static_cast operator in c++. typecasting helps move pointer in class hierarchy. , static_cast can downcast pointer in class hierarchial relationships. though, such conversions aren't safe, should careful while dealing it.


Comments