Namensräume
Varianten

Escape sequences

Aus cppreference.com
< cpp‎ | language


 
 
Sprache C++
Allgemeine Themen
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.
Flusskontrolle
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.
Bedingte Ausführung Aussagen
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.
Iterationsanweisungen
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.
Gehe Aussagen
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.
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktion Erklärung
Lambda-Funktion Erklärung
Funktions-Template
inline-Spezifizierer
Exception-Spezifikationen(veraltet)
noexcept Spezifizierer(C++11)
Ausnahmen
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
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)
Specifiers
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 Planer
Lagerdauer Planer
constexpr Spezifizierer(C++11)
auto Spezifizierer(C++11)
alignas Spezifizierer(C++11)
Initialisierung
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Literale
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressions
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
alternative Darstellungen
Utilities
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
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
Typ Aliasdeklaration(C++11)
Attribute(C++11)
Wirft
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
impliziten Konvertierungen
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
C-Stil und funktionale Besetzung
Speicherzuweisung
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.
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Class-spezifische Funktion Eigenschaften
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.
Besondere Member-Funktionen
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.
Templates
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Klassen-Template
Funktions-Template
Template-Spezialisierung
Parameter Packs(C++11)
Verschiedenes
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Inline Montage
 

Escape-Sequenzen werden verwendet, um bestimmte Sonderzeichen in String-Literalen zu definieren.

Die folgenden Escape-Sequenzen stehen zur Verfügung:

Escape
sequence
Description Representation
\' single quote byte 0x27
\" double quote byte 0x22
\? question mark byte 0x3f
\\ backslash byte 0x5c
\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 Unicode value.
Kann mehrere Zeichen ergeben.
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 Unicode value.
Kann mehrere Zeichen ergeben.
code point U+nnnnnnnn

[Bearbeiten]Notes

Die new-line Zeichen \n hat eine besondere Bedeutung, wenn im Text-Modus I / O verwendet wird, wird es dem OS-spezifische newline Byte oder Byte-Sequenz umgewandelt .
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.
Octal Escape-Sequenzen haben eine Frist von drei Oktalziffern, sondern enden an der ersten Zeichen, das nicht ein gültiger Oktalziffer ggf. auch früher .
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.
Hexadezimale Escape-Sequenzen haben keine Längenbegrenzung und enden mit dem ersten Zeichen, die keine gültige Hexadezimalzahl. Wenn der Wert von einem einzigen hexadezimale Escape-Sequenz dargestellt nicht passt den Bereich der Werte von der Charakter-Typ in dieser Zeichenfolge vertreten Literal (char, char16_t, char32_t oder wchar_t), ist das Ergebnis nicht näher .
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.
Eine universelle Charakter-Namen in einem engen String-Literal kann mehr als ein char aufgrund zuordnen Kodierung multibyte .
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.
Das Fragezeichen Escape-Sequenz \? wird verwendet, um trigraphs aus im Inneren Zeichenfolgenliterale interpretiert wird: ein String, wie "??/" als "\" kompiliert, aber wenn das zweite Fragezeichen entgangen, wie in "?\?/", wird es "??/"
Original:
The question mark escape sequence \? is used to prevent trigraphs 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.

[Bearbeiten]Beispiel

#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?"

[Bearbeiten]Siehe auch

close