나는이 다음과 같다 내가 자바 포트에 노력하고있어 일부 C++ 코드 :reinterpret_cast는 어떻게 작동합니까? (자바로 포팅 C++)
struct foostruct {
unsigned char aa : 3;
bool ab : 1;
unsigned char ba : 3;
bool bb : 1;
};
static void foo(const unsigned char* buffer, int length)
{
const unsigned char *end = buffer + length;
while (buffer < end)
{
const foostruct bar = *(reinterpret_cast<const foostruct*>(buffer++));
//read some values from struct and act accordingly
}
}
하고있는 reinterpret_cast
무엇입니까?
참조 http://stackoverflow.com/questions/4805058/is-there-cast-in-java-similar-to-reinterpret -cast-in-c – Raedwald