[ fromfile: types.xml id: whynotC-style ]
C-style casts are deprecated and should not be used anymore.
Consider the following situation, quite similar to the previous example.
Apple apple; Orange* orangeP; // other processing steps ... orangeP = (Orange*) &apple; orangeP->peel();
Errors caused by such a cast can be difficult to understand and correct.
If a system-dependent cast is necessary, it is preferable to use reinterpret_cast
over a C-style cast
when troubles arise, it will be easier to spot the likely source of those troubles in the source.
Note | |
---|---|
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |