What is a better way to convert C++ decimal int to hexadecimal char?
UPDATE:For example, 17 I hope that the result after the change is char(0x00) char(0x11) but not "11" char("1") char ("1")
走同样的路,发现不同的人生
A friend who is engaged in embedded technology recommended a method
x & 0xFF; x >> 8
int a=11123456;char str[20]={0};sprintf(str, "%x", a);
A friend who is engaged in embedded technology recommended a method
x & 0xFF; x >> 8
int a=11123456;
char str[20]={0};
sprintf(str, "%x", a);