數(shù)據(jù)強(qiáng)轉(zhuǎn) float 變 數(shù)組

float a = 0.123;
std::uint8_t* i = (unsigned char*)&a;
std::cout << *((float*)(i));
long b = 231;
std::uint8_t* f = (unsigned char*)&b;
std::cout << *((long*)(f));
標(biāo)簽:
float a = 0.123;
std::uint8_t* i = (unsigned char*)&a;
std::cout << *((float*)(i));
long b = 231;
std::uint8_t* f = (unsigned char*)&b;
std::cout << *((long*)(f));