最佳答案
我试图读入一行字符,然后打印出相当于十六进制的字符。
For example, if I have a string that is "0xc0 0xc0 abc123", where the first 2 characters are c0 in hex and the remaining characters are abc123 in ASCII, then I should get
c0 c0 61 62 63 31 32 33
然而,使用 %x的 printf给我
ffffffc0 ffffffc0 61 62 63 31 32 33
没有 "ffffff",我如何得到我想要的输出?为什么只有 c0(和80)有 ffffff,而其他字符没有?