-
Book Overview & Buying
-
Table Of Contents
C++ Memory Management
By :
You will use a cast to adjust the compiler’s view on the type of an expression. The thing is, the compiler sees our source code and understands what we wrote and what other people’s code expresses. Most of the time (hopefully), this code will make sense, and the compiler will translate your sources into proper binaries without complaining.
Sometimes, of course, there will be (hopefully temporary) discrepancies between programmer intent and code, as expressed through the sources seen by the compiler. Most of the time, the compiler will be right, and the programmer will rewrite the source code, at least in part, in order to better express the intent, inspired by the error or warning messages that revealed (in their own poetic way) a problem. Sometimes, of course, the source code matches the programmer’s intent, but there are still disagreements with the compiler and adjustments required to attain some agreement with it. For example, suppose a programmer...