Re: reinterpret_cast



Hi Slava

Looks like you are right - I changed declaration of struct to "public", so
that everything worked the way you said
(compile error with static_cast, but C-style cast produced the same result
as static_cast does). However, when I tried it with class, again, C-style
cast produced the same result as reinterpret_cast does. Therefore, there
must be some compiler error

I am going to re-install VC++ - probably, there is some run-time error or
something. I just wonder what happens


Regards

Anton Bassov
.



Relevant Pages

  • Re: reinterpret_cast
    ... struct/class makes no difference: the C-style cast still ... types were declared using the class keyword or the struct keyword. ... in such cases the C cast is always equivalent to static_cast (which will ... when I changed it to class, I got the compile error, telling me that "static ...
    (microsoft.public.win32.programmer.kernel)
  • Re: about casting
    ... The compile error was typo from me. ... Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast ... type of the parameter cannot derive from void or void* ... All parameters transmitted over the network must be derived from one of the MIDL base types. ...
    (microsoft.public.vc.mfc)