gpt4 book ai didi

c++ - C++ 对字 rune 字的顺序有什么保证?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:18:27 24 4
gpt4 key购买 nike

C++ 对字 rune 字的顺序有什么保证? 基本源字符集中的字符有明确的顺序吗? (例如 'a' < 'z' 保证是真的吗?'A' < 'z' 怎么样?)

最佳答案

该标准仅保证十进制数字 09 的顺序,来自草案 C++11 标准部分 2.3 [lex.charset]:

In both the source and execution basic character sets, the value of each character after 0 in the above list of decimal digits shall be one greater than the value of the previous.

否则说(强调我的):

The basic execution character set and the basic execution wide-character set shall each contain all the members of the basic source character set, plus control characters representing alert, backspace, and carriage return, plus a null character (respectively, null wide character), whose representation has all zero bits. For each basic execution character set, the values of the members shall be non-negative and distinct from one another.

请注意,EBCDIC具有非连续字符集。

关于c++ - C++ 对字 rune 字的顺序有什么保证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32586834/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com