در اکثر موارد به شکل صریح با پرانتر می توانید تبدیلات مجاز را انجام دهید.
char *y;
// fill it , use it
int* x = (int*) y;
در C++ برای این کار عملگرهایی خاصی وجود دارد که امن تر انجام می دهند، که برای کار شما reinterpret_cast نیاز هست(تبدیل هر نوعی)
int *x = reinterpret_cast<int*>( y );
سایر موارد:
dynamic_cast: Used for conversion of polymorphic types.
static_cast: Used for conversion of nonpolymorphic types.
const_cast : Used to remove the const, volatile, and __unaligned attributes.
reinterpret_cast: Used for simple reinterpretation of bits.
safe_cast : Used to produce verifiable MSIL.