我的函数将十六进制符号转换为 2 个字符的字符串,然后将其分解为 2 个 1 个字符的字符串。当我将结果字符串与常量字符串进行比较时,出现错误:Cannot convert 'unsigned char' to 'char *' first_ascii_code = 0x30;
编译器:C++ Builder 6
代码:
BYTE from_byte_to_ascii_codes(int input_byte);
// transformation hex into string with of 2 characters and then
// its transformation into 2 hex bytes. compiler - C++ Builder 6
BYTE from_byte_to_ascii_codes(int input_byte)
{
BYTE broken_input_byte[] = "";
input_byte = 0x01;
itoa(input_byte, broken_input_byte, 16);
// now broken_input_byte[] = "01";
if (broken_input_byte[0] == "0") { // here is mistake
//Cannot convert 'unsigned char' to 'char *'
first_ascii_code = 0x30;
}
我该如何纠正这个错误?