名前空間
変種
操作

Escape sequences

提供: cppreference.com
< cpp‎ | language


 
 
C + +言語
一般的なトピック
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ASCIIチャート
エスケープシーケンスを
の歴史、C + +
フロー制御
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
条件付き実行文
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
繰り返し文
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
文をジャンプします
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
関数の宣言
ラムダ関数の宣言
関数テンプレート
の歴史。インライン指定
例外仕様 (廃止予定)
noexcept指定子 (C++11)
例外
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
名前空間
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
指定子
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CV指定
貯蔵期間指定
constexprの指定子 (C++11)
自動指定 (C++11)
alignas指定子 (C++11)
初期化
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
リテラル
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
代替表現
ユーティリティ
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
型の別名宣言 (C++11)
属性 (C++11)
キャストします
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
暗黙の型変換
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Cスタイルキャストと機能
メモリの割り当て
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
クラス
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
クラス固有の機能特性
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
明示 (C++11)
静的
特殊なメンバ関数
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
テンプレート
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
クラステンプレート
関数テンプレート
テンプレートの特殊化
パラメーターパック (C++11)
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
インラインアセンブリ
 
エスケープシーケンスは、文字列リテラル内に特定の特殊文字を定義するために使用され.
Original:
Escape sequences are used to define certain special characters within string literals.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
以下のエスケープシーケンスが用意されています
Original:
The following escape sequences are available:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Escape
sequence
Description Representation
\' single quote byte 0x27
\" double quote byte 0x22
\? question mark byte 0x3f
\\ backslash byte 0x5c
\0 null character byte 0x00
\a audible bell byte 0x07
\b backspace byte 0x08
\f form feed - new page byte 0x0c
\n line feed - new line byte 0x0a
\r carriage return byte 0x0d
\t horizontal tab byte 0x09
\v vertical tab byte 0x0b
\nnn arbitrary octal value byte nnn
\xnn arbitrary hexadecimal value byte nn
\u
NNNN
Original:
nnnn
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
arbitrary ユニコード value.
May result in several characters.
code point U+nnnn
\U
NNNNNNNN
Original:
nnnnnnnn
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
arbitrary ユニコード value.
May result in several characters.
code point U+nnnnnnnn

[編集] ノート

テキストモードのI / Oで使用された場合、改行文字\nは特別な意味を持っている、それは、OS固有の改行バイトまたはバイトシーケンスに変換されている.
Original:
The new-line character \n has special meaning when used in text mode I/O, it is converted to the OS-specific newline byte or byte sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
進数のエスケープシーケンスは、3桁の8進数の限界を持っていますが、より早く検出された場合、有効な8進数字ではない最初の文字で終了し.
Original:
Octal escape sequences have a limit of three octal digits, but terminate at the first character that is not a valid octal digit if encountered sooner.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
16進数のエスケープシーケンスの長さに制限がなく、有効な16進数の数字ではない最初の文字で終了します。単一の16進数のエスケープシーケンスによって表される値がこの文字列で使用する文字の種類によって表される値の範囲に収まらない場合はリテラル(charchar16_tchar32_t、またはwchar_t)、結果は不定です.
Original:
Hexadecimal escape sequences have no length limit and terminate at the first character that is not a valid hexadecimal digit. If the value represented by a single hexadecimal escape sequence does not fit the range of values represented by the character type used in this string literal (char, char16_t, char32_t, or wchar_t), the result is unspecified.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
リテラル文字列内の狭いユニバーサル文字名はエンコードをマルチバイトに複数のChar原因にマップされる場合があります.
Original:
A universal character name in a narrow string literal may map to more than one char due to multibyte encoding.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
疑問符のエスケープシーケンス\?は、文字列リテラル内で解釈されるの​​トリグラフを防ぐために使用されます:そのような"??/"として文字列が"\"としてコンパイルされますが、2番目の疑問符が"?\?/"のように、エスケープされている場合、それは"??/"なります
Original:
The question mark escape sequence \? is used to prevent トリグラフ from being interpreted inside string literals: a string such as "??/" is compiled as "\", but if the second question mark is escaped, as in "?\?/", it becomes "??/"
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
 
int main()
{
    std::printf("This\nis\na\ntest\n\nShe said, \"How are you?\"\n");
}

Output:

This
is
a
test
 
She said, "How are you?"

[編集] も参照してください