So far there seems to be no correct answer among the 12 answers. Many fail at limiting the values to the 0 to 127 range as ASCII is a 7 bit encoding, and so far none has solved the problem that the numerical value of a character in C doesn't have to be the ASCII value! The system/compiler could also be using something like EBCDIC encoding, then the numerical value of an 'a' would not be the ASCII value of an 'a' in C.
以上就是Printing chars and their ASCII-code in C的详细内容,更多请关注web前端其它相关文章!