char buffer_b[5] = { 0xDA, 0x00, 0x04, 0x00, 0x07 }; printf("%d\n%d\n%d", buffer_b[0], buffer_b[2], buffer_b[4]);
This gives me the conclusion:
-38 4 7
However, I expect:
218 4 7
Thank.
char. Use unsigned char.
use% ud as well.
, char . ( , , .) , , - 0xDA, , . printf, () char int . %d, printf .
char
printf
int
%d
unsigned, %u. unsigned, unsigned char uint8_t, printf printf.
%u
unsigned char
uint8_t
char 0xDA int, printf, , 0xffffffda, 32- -38. , 0x000000da. , , signed char unsigned char. , .
0xDA
0xffffffda
-38
0x000000da
signed char
, - char, .
Source: https://habr.com/ru/post/1742488/More articles:Preloader stops flash movie in IE - browserAjax page.replace_html problems with partial in Rails - ruby | fooobar.comgzip: stdout: file too large when starting the backup script - bashBinding DropDownList inside DetailsView - c #What is the best license for my open source project? - licensingIs there a better way to write named-pipes in F #? - f #Cannot find controls in FormView.InsertItemTemplate even with DataBound - .netjQuery - Programmatically Trigger Event - javascriptWhat happened to this line? - stringError passing a template function as an argument to another function in C ++ - c ++All Articles