I wonder why the following code does not work as I expect:
unsigned char c=0,d=0;
char str[]="0102";
int result=sscanf(str,"%2hhx%2hhx",&c,&d);
I expect c=1 and d=2 but actually c=0 and d=2. Why?
I wonder why the following code does not work as I expect:
unsigned char c=0,d=0;
char str[]="0102";
int result=sscanf(str,"%2hhx%2hhx",&c,&d);
I expect c=1 and d=2 but actually c=0 and d=2. Why?