C 문자 상수C Character Constants

"문자 상수"는 표현 가능한 문자 집합의 단일 문자를 작은따옴표(' ')로 묶어 구성합니다.A "character constant" is formed by enclosing a single character from the representable character set within single quotation marks (' '). 문자 상수는 실행 문자 집합에서 문자를 나타내는 데 사용됩니다.Character constants are used to represent characters in the execution character set.

구문Syntax

character-constant:character-constant:
' c-char-sequence '' c-char-sequence '

L' c-char-sequence 'L' c-char-sequence '

c-char-sequence:c-char-sequence:
c-charc-char

c-char-sequence c-charc-char-sequence c-char

c-char:c-char:
작은 따옴표('), 백슬래시(\) 또는 줄 바꿈 문자를 제외한 소스 문자 집합의 모든 멤버Any member of the source character set except the single quotation mark ('), backslash (\), or newline character

escape-sequenceescape-sequence

escape-sequence:escape-sequence:
simple-escape-sequencesimple-escape-sequence

octal-escape-sequenceoctal-escape-sequence

hexadecimal-escape-sequencehexadecimal-escape-sequence

simple-escape-sequence: 다음 중 하나simple-escape-sequence: one of
\a \b \f \n \r \t \v\a \b \f \n \r \t \v

\' \" \\ \?\' \" \\ \?

octal-escape-sequence:octal-escape-sequence:
\ octal-digit\ octal-digit

\ octal-digit octal-digit\ octal-digit octal-digit

\ octal-digit octal-digit octal-digit\ octal-digit octal-digit octal-digit

hexadecimal-escape-sequence:hexadecimal-escape-sequence:
\x hexadecimal-digit\x hexadecimal-digit

hexadecimal-escape-sequence hexadecimal-digithexadecimal-escape-sequence hexadecimal-digit

참고 항목See Also

C 상수C Constants