string literal
From cppreference.com
This section is incomplete Reason: C++11 stuff |
Contents |
[edit] Syntax
" (unescaped_character|escaped_character)* " | (1) | ||||||||
L " (unescaped_character|escaped_character)* " | (2) | ||||||||
[edit] Explanation
- unescaped_character
- Any valid character
- escaped_character
- see escape sequences
[edit] Type
- The type of an unprefixed string literal is const char*
- The type of a L"..." string literal is const wchar_t*
[edit] Notes
- String literals can be concatenated
- The NUL character \0 is always appended to the string
- Can be used to initialize character arrays
[edit] Example
char array[] = "Foo" "bar"; // same as char array[] = { 'F', 'o', 'o', 'b', 'a', 'r', '\0' };