My function transforms hex symbol into string of 2 characters, then breaks it into 2 strings of 1 characters. When I compare resulted string with constant string, I get an error: Cannot convert 'unsigned char' to 'char *' first_ascii_code = 0x30;
compiler: C++ Builder 6
code:
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;
}
How can I correct this error?