Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 1.81 KB

File metadata and controls

82 lines (65 loc) · 1.81 KB
title C Character Constants | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-language
ms.tgt_pltfrm
ms.topic article
dev_langs
C++
helpviewer_keywords
characters, constants
(') single quotation mark
constants, character
single quotation mark
ms.assetid 388ae7d7-2c3a-44d6-a507-63f541ecd2da
caps.latest.revision 11
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

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:
' c-char-sequence '

L' 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 quotation mark ('), backslash (\), or newline character

escape-sequence

escape-sequence:
simple-escape-sequence

octal-escape-sequence

hexadecimal-escape-sequence

simple-escape-sequence: one of
\a \b \f \n \r \t \v

\' \" \\ \?

octal-escape-sequence:
\ octal-digit

\ octal-digit octal-digit

\ octal-digit octal-digit octal-digit

hexadecimal-escape-sequence:
\x hexadecimal-digit

hexadecimal-escape-sequence hexadecimal-digit

See Also

C Constants