P
Pallav singh
Reinterpret Cast
The reinterpret_cast is necessary here, because the compiler doesn't
have any information available about the relationship between the
types Y and Z.
class Y;
class Z;
Y *convert( Z * );
The problem arises when a programmer tries to force the issue;
ignorance is bliss only to a certain extent:
Y *convert (Z *zp)
{return reinterpret_cast<Y *>(zp); }
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
can anyone give me scenario where we will be practically using it ?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The reinterpret_cast is necessary here, because the compiler doesn't
have any information available about the relationship between the
types Y and Z.
class Y;
class Z;
Y *convert( Z * );
The problem arises when a programmer tries to force the issue;
ignorance is bliss only to a certain extent:
Y *convert (Z *zp)
{return reinterpret_cast<Y *>(zp); }
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
can anyone give me scenario where we will be practically using it ?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++