I want to convert a character to hexadecimal value.
and that value should be a unsigned char value.
e.g.
unsigned char a[16] = {0x00,0x44,...};
this is the code segment i wrote.
but its not working properly.
unsigned char a1= 'D';
unsigned char a[4] ;
unsigned char temp[16];
sprintf((char *)a,"0x%02X",a1);
cout<<a;
unsigned char *b=a;
cout<<b;
temp[0] = b;
can anyone help me to overcome from this issue