◐ Shell
clean mode source ↗

std::basic_string::c_str – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

const CharT* c_str() const;

Gibt einen Zeiger auf eine Null-terminierte Zeichenarray mit Daten entsprechen denen in der Zeichenkette gespeichert. Der Zeiger ist derart, dass der Bereich [c_str(); c_str() + size()] gültig ist und die Werte darin zu den Werten in der Zeichenfolge mit einem zusätzlichen Null-Zeichen nach der letzten Position gelagert entsprechen .

Original:

Returns a pointer to a null-terminated character array with data equivalent to those stored in the string. The pointer is such that the range [c_str(); c_str() + size()] is valid and the values in it correspond to the values stored in the string with an additional null character after the last position.

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

Notes

Der Zeiger von c_str() erhalten darf nur als Zeiger auf einen null-terminierten Zeichenkette, wenn der String-Objekt enthält keine anderen null Zeichen behandelt werden .

Original:

The pointer obtained from c_str() may only be treated as a pointer to a null-terminated character string if the string object does not contain other null characters.

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

Schriftlich an den Zeichen-Array durch c_str() zugegriffen wird undefinierten Verhalten .

Original:

Writing to the character array accessed through c_str() 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.

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

Original:

Since C++11, c_str() and data() 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

Zeiger auf null-terminierte Zeichenarray, dass data()[i] == operator[](i) für jeden i in [0, size()]. (bis C + +11)

Original:

Pointer to the null-terminated character array 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]

liefert einen Zeiger auf das erste Zeichen eines Strings

Original:

returns a pointer to the first character of a 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]