Top "Reinterpret-cast" questions

A C++ operator that simply allows the conversion between types by reinterpreting the underlying bit pattern.

When to use reinterpret_cast?

I am little confused with the applicability of reinterpret_cast vs static_cast. From what I have read the general …

c++ casting reinterpret-cast
Proper way of casting pointer types

Considering the following code (and the fact that VirtualAlloc() returns a void*): BYTE* pbNext = reinterpret_cast<BYTE*>( VirtualAlloc(…

c++ pointers casting reinterpret-cast static-cast
Should I use static_cast or reinterpret_cast when casting a void* to whatever

Both static_cast and reinterpret_cast seem to work fine for casting void* to another pointer type. Is there a …

c++ pointers static-cast reinterpret-cast
Why doesn't this reinterpret_cast compile?

I understand that reinterpret_cast is dangerous, I'm just doing this to test it. I have the following code: int …

c++ casting reinterpret-cast
Why can't I static_cast between char * and unsigned char *?

Apparently the compiler considers them to be unrelated types and hence reinterpret_cast is required. Why is this the rule?

c++ char reinterpret-cast static-cast unsigned-char
Way to get unsigned char into a std::string without reinterpret_cast?

I have an unsigned char array that I need in a std::string, but my current way uses reinterpret_cast …

c++ stdstring reinterpret-cast
reinterpret_cast casts away qualifiers

I add an issue on reinterpreting a variable and I don't know why.. int ProgressBar(const uint64_t data_sent, …

c++ casting reinterpret-cast
How does qobject_cast work?

I just found the following code in Qt and I'm a bit confused what's happening here. Especially as to what …

c++ qt casting reinterpret-cast static-cast
const_cast vs reinterpret_cast

Referring the SO C++ FAQ When should static_cast, dynamic_cast and reinterpret_cast be used?. const_cast is used …

c++ casting constants reinterpret-cast
Is C++ considered weakly typed? Why?

I've always considered C++ to be one of the most strongly typed languages out there. So I was quite shocked …

c++ strong-typing reinterpret-cast weak-typing