0
votes

The character constants are defined in c11 as:
Syntax
  character-constant:
   ' c-char-sequence '
   L' c-char-sequence '
   u' c-char-sequence '
   U' c-char-sequence '
  c-char-sequence:
   c-char
   c-char-sequence c-char
  c-char:
   any member of the source character set except the single-quote ', backslash \, or new-line character
   escape-sequence

It is defined recursively, so inside the single-quotes, there are one or more c-chars, like 'abc'.
However as I know, a character constant contains only one c-char, like 'a', doesn't it?

1
Characters are UTF-8 as far as I know. It can support characters beyond what ASCII can. See here stackoverflow.com/questions/10229156/… - Dustin Nieffenegger
The Macintosh File System used four bytes constants for file types and file application creator, like 'TEXT' for a text file, 'APPL' for an application. File name extensions were rarely used (mostly used for programming and web publishing). - curiousguy

1 Answers

0
votes

as I know, a character constant contains only one c-char, like 'a', doesn't it?

no, 'abcd' is also a character constant. Its value is technically implementation-defined, but everywhere I've looked it was formed out of the values of the chars, in big-endian order (in that case, 0x61626364)

The C side of cppreference has a discussion of various character constants