We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
char str [4];
sprintf (str, "%.2x", 0x01);//Conversion of byte to the 2nd bit hexadecimal value
I expect in str[0] 0 character, in str[1] 1 character, that is '0' and '1'. As a result function returns '1' and 'C'. Remaining numbers - it is normal...
And yes. MCS51 shouldn't offend. :) Similar it is just such realization of the sprintf function in the environment of KEIL.