◐ Shell
clean mode source ↗

std::basic_string::data – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

const CharT* data() const;

Liefert Zeiger auf das zugrunde liegende Array dient als Zeichen Speicher .

Original:

Returns pointer to the underlying array serving as character storage.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Wenn empty() kehrt false, ist der Zeiger, so dass der Bereich [data(); data() + size()) gültig ist und die Werte darin zu den Werten in der Zeichenfolge gespeichert sind. Wenn empty() kehrt true, ist der Zeiger ein nicht-Null-Zeiger nicht zu dereferenziert. (bis C + +11)

Original:

If empty() returns false, the pointer is such that the range [data(); data() + size()) is valid and the values in it correspond to the values stored in the string. If empty() returns true, the pointer is a non-null pointer that should not be dereferenced. (bis C + +11)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Der Zeiger ist derart, dass der Bereich [data(); data() + size()] gültig ist und die Werte darin zu den Werten in der Zeichenfolge (einschließlich des zusätzlichen Nullzeichen) gespeichert entsprechen, auch wenn empty() kehrt true. (seit C++11)

Original:

The pointer is such that the range [data(); data() + size()] is valid and the values in it correspond to the values stored in the string (including the additional null character) even when empty() returns true. (seit C++11)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Notes

Schriftlich an den Zeichen-Array durch data zugegriffen wird undefinierten Verhalten .

Original:

Writing to the character array accessed through data is undefined behavior.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Der Zeiger von data() erhalten sollte nicht als gültig angesehen werden, nachdem alle nicht-const-Betrieb auf der Saite .

Original:

The pointer obtained from data() should not be considered valid after any non-const operation on the string.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Da C + 11, und data() c_str() die gleiche Funktion .

Original:

Since C++11, data() and c_str() perform the same function.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parameter

(None)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Rückgabewert

Pointer auf die zugrunde liegende Charakter Speicher, so dass data()[i] == operator[](i) für jeden i in [0, size()). (bis C + +11)

Original:

Pointer to the underlying character storage such that data()[i] == operator[](i) for every i in [0, size()). (bis C + +11)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Pointer auf die zugrunde liegende Charakter Speicher, so dass data() + i == &operator[](i) für jeden i in [0, size()]. (seit C++11)

Original:

Pointer to the underlying character storage such that data() + i == &operator[](i) for every i in [0, size()]. (seit C++11)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Komplexität

Constant .

Original:

Constant.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Ausnahmen

Siehe auch

(C++11)

greift auf das erste Zeichen

Original:

accesses the first character

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(öffentliche Elementfunktion) [edit]

(C++11)

greift das letzte Zeichen

Original:

accesses the last character

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(öffentliche Elementfunktion) [edit]

gibt eine nicht-modifizierbare Standard C Zeichenarray Version der Zeichenfolge

Original:

returns a non-modifiable standard C character array version of the string

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(öffentliche Elementfunktion) [edit]