Is the character set of a char literal guaranteed to be ASCII?

后端 未结 4 1122
春和景丽
春和景丽 2020-12-07 01:47

Coming from a discussion started here, does the standard specify values for characters? So, is \'0\' guaranteed to be 48? That\'s what ASCII would tell us, but

4条回答
  •  春和景丽
    2020-12-07 02:24

    No, the Standard is very careful not to specify what the source character encoding is.

    C and C++ compilers run on EBCDIC computers too, you know, where '0' != 0x30.

    However, I believe it is required that '1' == '0' + 1.

提交回复
热议问题