|
|
|
Constraints 9 The value of an octal or hexadecimal escape sequence shall be in the range of unsigned char for an integer character constant, or the unsigned type corresponding to wchar_t for a wide character constant. Semantics 10 An integer character constant has type int . The value of an integer character constant containing a single character that maps to a single-byte execution character is the 'ab' ), or containing a character or escape sequence that does not map to a single-byte execution character, is implementation-defined. If an integer character constant contains char whose value is that of the single character or escape sequence is converted to type int . 11 A wide character constant has type wchar_t , an integer type defined in the <stddef.h> header. The value of a wide character constant containing a single multibyte character that maps to a member of the extended execution character set is the mbtowc function, with an implementation-defined current locale. The value of a wide character 12 EXAMPLE 1 The construction '\0' is commonly used to represent the null character. 13 EXAMPLE 2 Consider implementations that use two’s-complement representation for integers and eight bits for objects that have type char . In an implementation in which type char has the same range of values as signed char , the integer character constant '\xFF' has the value −1 ; if type char has the same range of values as unsigned char , the character constant '\xFF' has the value +255 . 14 EXAMPLE 3 Even if eight bits are used for objects that have type char , the construction '\x123' specifies an integer character constant containing only one character, since a hexadecimal escape sequence '\x12' and '3' , the construction '\0223' may be used, since an octal escape sequence is terminated after three octal digits. (The value of this two-character integer character 15 EXAMPLE 4 Even if 12 or more bits are used for objects that have type wchar_t , the construction L'\1234' specifies the implementation-defined value that results from the combination of the values 0123 and '4' . Forward references: common definitions <stddef.h> (7.17), the mbtowc function (7.20.7.2). §6.4.4.4 Language 61 |