Byte2Hex

 

Contents

Description

Convert byte value to hex string.

Syntax

bool Byte2Hex( BYTE bValue, LPSTR lpBuff )

Parameters

bValue
[input] byte value.
lpBuff
[output] the buffer to return hex string

Return

returns true if successfully, else return false.

Examples

EX1

void Byte2Hex_ex1()
{
    BYTE bValue = 10;
    char pchar[20];    
    bool bRet = Byte2Hex(bValue, pchar);
    if(bRet)
    {
        out_str(pchar); // output 0A
    }
    else
    {
        out_str("Fail to convert");
    }
}

Remark

See Also

Hex2Dec, Bin2Dec

header to Include

origin.h

Reference