Namespaces
Variants
Views
Actions

character literal

From cppreference.com
< cpp‎ | language
Revision as of 19:00, 31 May 2013 by P12bot (Talk | contribs)

 
 
C++ language
General topics
Flow control
Conditional execution statements
Iteration statements (loops)
Jump statements
Functions
Function declaration
Lambda function declaration
inline specifier
Exception specifications (deprecated)
noexcept specifier (C++11)
Exceptions
Namespaces
Types
Specifiers
decltype (C++11)
auto (C++11)
alignas (C++11)
Storage duration specifiers
Initialization
Expressions
Alternative representations
Literals
Boolean - Integer - Floating-point
Character - String - nullptr (C++11)
User-defined (C++11)
Utilities
Attributes (C++11)
Types
typedef declaration
Type alias declaration (C++11)
Casts
Implicit conversions - Explicit conversions
static_cast - dynamic_cast
const_cast - reinterpret_cast
Memory allocation
Classes
Class-specific function properties
Special member functions
Templates
Miscellaneous
 

Contents

Syntax

' unescaped_character|escaped_character ' (1)
L ' unescaped_character|escaped_character ' (2)
u ' unescaped_character|escaped_character ' (since C++11) (3)
U ' unescaped_character|escaped_character ' (since C++11) (4)
' (unescaped_character|escaped_character)+ ' (5)

Explanation

unescaped_character
Any valid character
escaped_character
see escape sequences

Type

  1. char
  2. wchar_t
  3. char16_t
  4. char32_t
  5. int

Note

Multicharacter literals (5) have implementation-defined value