February 2022
Beginner
848 pages
22h 40m
English
Casting is a mechanism by which a programmer can temporarily or permanently change how the compiler interprets an object. (The programmer does not change the object itself but simply changes the interpretation of the object.) Operators that change the interpretation of objects are called casting operators.
In this lesson, you learn
■ The need for casting operators
■ Why C-style casts are not popular
■ The four C++ casting operators
■ The concepts of upcasting and downcasting
■ Why C++ casting operators are not strongly recommended
A perfectly type-safe and type-strong world of well-written C++ applications has no need for casting or for casting operators. However, we live in a world ...
Read now
Unlock full access