c++ 16進位制資料轉double

giantmfc123發表於2020-09-27
    unsigned char p[8] ={0xf5,0xdd,0xd8, 0xac, 0x2d, 0xf4, 0x3e,0x40};//順序是反的
    double value = 0;
    unsigned char * b = (unsigned char*)&value;
    for(int i = 0; i<8; i++)
    {
        b[i] = (unsigned char)p[i];
    }
    qDebug() << value;

輸出結果是:30.9538

相關文章