string literal
Материал из cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Этот раздел не завершён Причина: C++11 stuff |
Содержание |
[править] Синтаксис
" (unescaped_character|escaped_character)* "
|
(1) | ||||||||
L " (unescaped_character|escaped_character)* "
|
(2) | ||||||||
[править] Объяснение
, Unescaped_character
Original:
;unescaped_character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- Любой действительный характерOriginal:Any valid characterThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
, Escaped_character
Original:
;escaped_character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[править] Type
# Тип префикса строковый литерал const char*
Original:
# The type of an unprefixed string literal is const char*
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
# Тип L"..." строковый литерал const wchar_t*
Original:
# The type of a L"..." string literal is const wchar_t*
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[править] Notes
- Строковые литералы могут быть объединеныOriginal:String literals can be concatenatedThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Нулевой символ \ 0 всегда добавляется к строкеOriginal:The NUL character \0 is always appended to the stringThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Может быть использован для инициализации символьных массивовOriginal:Can be used to initialize character arraysThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[править] Пример
char array[] = "Foo" "bar"; // same as char array[] = { 'F', 'o', 'o', 'b', 'a', 'r', '\0' };